I'm trying a simple web service example and I get this error even though I uncommented extension=php_soap.dll
in the php.ini
file:
Fatal error: Class 'SoapClient' not found in C:\Program Files (x86)\EasyPHP-5.3.9\www\server.php on line 2
Diagnose
Look up the following inside your script file
phpinfo();
If you can't find Soap Client
set to enabled
like so:
Fix
Do the following:
php.ini
in your apache bin folder, I.e Apache/bin/php.ini
;
from the beginning of extension=php_soap.dll
phpinfo();
again and check if you see a similar picture to the one aboveOn the other hand if this doesn't solve your issue, you may want to check the requirements for SOAP here. Also in the comment section you can find good advice on connecting to https.
Don't forget to also uncomment this line:
;extension=php_openssl.dll
if the WSDL you are trying to reach is under https protocolI am using xamp and just uncommenting
extension=soap
do the trick.sudo apt-get install php7.0-soap for those of you who haven't installed it yet
For me, The
SoapClient
class is still not found. I see it enabled in the phpinfo(), the extension is enabled, openssl is enabled too, everything is ok but the class isn't found. I use Wampserver 3.0 and PHP 5.6 and I restarted Apache but doesn't solve the problem. Please help.If I follow the above comment (
apt-get install php7.0-soap
) on Ubuntu 20.04.01, I get this error: Unable to locate package php7.0-soap. Runningapt-get install php-soap
fixes the issue and installs the appropriate soap version for this OS (7.4 in my case).