Fatal Error: Class 'Soapclient' Not Found

Fatal error: Class 'SoapClient' not found

Diagnose

Look up the following inside your script file

phpinfo();

If you can't find Soap Client set to enabled like so:
the way soap should appear in phpinfo()

Fix

Do the following:

  1. Locate php.ini in your apache bin folder, I.e Apache/bin/php.ini
  2. Remove the ; from the beginning of extension=php_soap.dll
  3. Restart your Apache server
  4. Look up your phpinfo(); again and check if you see a similar picture to the one above
  5. If you do, problem solved!

On 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.

PHP Fatal error: Class 'SoapClient' not found

Unfortunately there is nothing you can do code-wise. You need to contact the server host and have them install the SoapClient extension on the box and re-compile/restart.

PHP Fatal error: Class 'SoapClient' not found in laravel 5.4

PHP Fatal error: Class 'SoapClient' not found in laravel 5.4 means that the SoapClient class does not been enabled in your server. To do so, follow these steps:

  1. Check first if it's enabled with phpinfo() function and look in the array if SoapClient is mentioned enabled. If it's not enabled, follow the second step.
  2. Uncomment the extension=php_soap.dll line by removing the semicolon at the beginning, in php.ini file.
  3. The next step is to restart your server.
  4. Now return again to the first step to see if SoapClient is now enabled.
  5. At this step, you can now import your class like this:

use SoapClient;
$client = new SoapClient($wsdl, array('soap_version' => SOAP_1_1, 'trace' => true));

PHP Fatal error: Uncaught Error: Class 'SoapClient' not found

Ok, after a lot of trials and research, here is how I resolved it:

sudo a2dismod php7.0
sudo a2enmod php7.2
sudo systemctl restart apache2

Basically, the issue was that my system had two valid versions of PHP and it was configured to use the old one, by these commands you dismod PHP7.0 (disable module) and enmod PHP7.2

Fatal error: Class 'SoapClient' not found after upgrading PHP from version 7.0 to 7.2

To install SOAP in PHP 7.2 run following in your Ubuntu 16.04 terminal:

  1. sudo apt-get install php7.2-soap
  2. sudo service apache2 restart

Class 'SoapClient' not found

enable your soap extension in php.
open php.ini find the line have "php_soap" and uncomment this line,
restart web server, problem solved.



Related Topics



Leave a reply



Submit