SoapClient class missing - php

I need to use SoapClient class. Once I run a script that use it I get the following error:Fatal error: Class 'SoapClient' not found in /home/example/public_html/affiliate_script/acquireFeeds.php on line 11
I have already asked my client to install it but he says it is impossible so far. Do you know any class that could be equivalent to the SoapClient and can be downloaded?

You could try NuSOAP which is a PHP-only solution that requires no extensions to be present (besides XML handling extensions I suppose).

Related

Guzzle6 Client and CLientInterface file Namespaces not resolving in custom PHP Class

I have a php class that is using Client from Guzzle 6 and composer but when I try to load my page I get an error saying: PHP Fatal error: Interface 'GuzzleHttp\ClientInterface' not found even though I am importing the correct class. When I ctrl click the use statement it takes me directly to the ClientInterface.php in Guzzle. I am unsure why I am getting the PHP error. Any ideas? I tried importing and including, neither works.
Method 1:
use GuzzleHttp\Client;
use GuzzleHttp\ClientInterface;
Method 2:
require_once 'vendor/guzzlehttp/guzzle/src/Client.php';
require_once 'vendor/guzzlehttp/guzzle/src/ClientInterface.php';

Error: Class 'SplEnum' not found in PHP 7

I have a project with PHP 7.3, under Windows 10. I use the PHP from Xampp.
I get the following error:
Fatal error: Uncaught Error: Class 'SplEnum' not found in [...]
for
class BanLevel extends SplEnum { ... }
It seems I am misunderstanding the docu:
https://www.php.net/manual/en/class.splenum.php
https://www.php.net/manual/en/spl.installation.php
This gives me the idea it should be included in my PHP artefact.
What am I missing?
UPDATE:
The class.splenum.php page has gone offline. It is still available in Romanian, though: https://www.php.net/manual/ro/class.splenum.php, or here: https://php-legacy-docs.zend.com/manual/php5/en/class.splenum
It seems I checked the wrong documentation,
this is the right one:
https://www.php.net/manual/en/spl-types.installation.php
It clarifies:
This PECL extension is not bundled with PHP.
A DLL for this PECL extension is currently unavailable.
So I can't use SPLEnum under Windows, except I compile it into PHP.
UPDATE:
The spl-types.installation.php page does not exist on php.net anymore, but it is still available here:
https://php-legacy-docs.zend.com/manual/php5/en/spl-types.installation

Missing XMLReader Class

I am playing around with parsing spreadsheets and found the spreadsheet-reader class. I installed and have a very simple program written to open and parse an ".ODS" spreadsheet file. When I run it I get the error:
PHP Fatal error: Class 'XMLReader' not found in...
The line in question:
$ss = new SpreadsheetReader("test.ods");
So I google around and find out the version of PHP on that system needs to be at least 5.1 for it to use the version of XMLReader built into the core of PHP. I am using 5.4.12 there. I check with php -i and find PHP was compiled with: '--enable-xmlreader=shared'. According to the docs nothing needs to be configured at runtime to enable it.
Where else can I check and what am I doing wrong?
The solution is because PHP was built with a shared object file you DO need to modify php.ini: extension=xmlreader.so.

zend framework 2 fatal error after add module

I install ZF2 on my localhost and then I test the public page and it is work.
I tried to download a module MwopGuestbook and then zend show me an error:
Fatal error: Interface 'Zend\Module\Consumer\AutoloaderProvider' not
found in D:\xampp\htdocs\zend\module\MwopGuestbook\Module.php on line 8
How can we solve this problem?
Looks like outdated code there, I'm guessing that's an early incarnation of the Zend\ModuleManager\Feature\* implementations
If it is, you can try changing the first 7 lines in MwopGuestbook/Module.php to the following...
<?php
namespace MwopGuestbook;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
class Module implements AutoloaderProviderInterface
{
It should solve the complaints about not finding the interface, no guarantees there aren't other parts of that code using outdated calls though :-/

Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll()

I am upgrading a site from Fedora 14, PHP4, and PEAR DB to Fedora 16, PHP 5.4 and PEAR MDB2 2.5.0b3, and I am getting the error
Fatal error: Call to undefined function: MDB2_Driver_MYSQL::getAll(). in /usr/share/php/MDB2.php on line 1892
Obviously, I've checked line 1892 of the MDB2.php file, and it contains the error reporting code for the __call magic method (allows you to call a specific function by passing it into __call)
I have checked for usages of __call, and there don't seem to be any. Likewise, when I try to find where MDB2_Driver_MYSQL is coming from, the only place it is even mentioned is in MDB2.php (as a comment about the driver for MySQL), in the class declaration (class MDB2_Driver_mysql extends MDB2_Driver_Common), and the description title in the .xml file.
I have manually included the /usr/share/php/MDB2/Extended.php file in the file where the MDB2_Driver_mysql class is defined, and that didn't help (not that this would have been a permanant fix...)
Has anyone encountered this error, and if so, what did you do to fix it? Google has proved nearly useless, as the only place it is specifically mentioned doesn't really deal with fixing it.
change getAll() in your class, to queryAll(), cause there some difference between DB & MDB2, and the same with getOne, getRow - they all changed to queryOne, queryRow. Here you can read about it http://www.phpied.com/db-2-mdb2/
Make sure you load the extended module in your code prior to making a query, similar to below:
$db->loadModule('Extended');

Categories