5

I upgraded PHP 7.0 to 7.2 in Ubuntu. After performing an upgrade, I installed Laravel 5.6.

Before the upgrade, class 'SoapClient' is true, but after the upgrade, I encountered

Fatal error: Class 'SoapClient' not found

I checked php.ini in /etc/php/7.2/apache2/php.ini but I didn't see extension=php_soap.dll in php.ini.

How to resolve this issue?

Hiren Gohel
  • 4,942
  • 6
  • 29
  • 48
hadi
  • 85
  • 1
  • 1
  • 5
  • 1
    Locate `php.ini` in your **apache** bin folder, I.e `Apache/bin/php.ini` Remove the `;` from the beginning of `extension=php_soap.dll` and from `extension=php_openssl.dll` Restart your Apache server – Hiren Gohel Feb 19 '18 at 10:00
  • @HirenGohel , hi. Where is `Apache/bin/php.ini` in ubuntu? – hadi Feb 19 '18 at 10:02
  • You told in your question that you don't see extension. The reason is you aren't using the Apache built plugin for PHP. The file paths still work as is listed here to this day (confirmed on my 15.04 VM) See this answer: https://askubuntu.com/questions/356968/find-the-correct-php-ini-file/356990 – Hiren Gohel Feb 19 '18 at 10:08
  • Also, have you already installed soap? First you need to check it! If you not installed then run this command to install it: `sudo apt-get install php7.2-soap` – Hiren Gohel Feb 19 '18 at 10:12
  • @HirenGohel , I run `sudo apt-get install php7.2-soap` but don't see `extension=php_soap.dll` in `/etc/php/7.2/apache2/php.ini` – hadi Feb 19 '18 at 10:28
  • Run this 2 command: `sudo service php7.2-fpm restart` and `sudo service apache2 restart` – Hiren Gohel Feb 19 '18 at 10:34

3 Answers3

10

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
mySun
  • 1,550
  • 5
  • 32
  • 52
3

Look up the following inside your script file

phpinfo();

Do the following:

1.Locate php.ini in your apache bin folder, I.e Apache/bin/php.ini. Remove the ; from the beginning of extension=php_soap.dll

2.Restart your Apache server

EDIT:

For your problem you only need to install soap.

Run sudo apt-get install php7.2-soap to install soap and also run sudo service php7.2-fpm restart and sudo service apache2 restart and your problem fixed!

Hiren Gohel
  • 4,942
  • 6
  • 29
  • 48
1

First, check by phpinfo(); This will show you Soap Client is it enable or not

If it is disabled 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 extension=php_soap.dll not found in your php.ini follow below steps

  1. sudo apt-get install php7.2-soap
  2. sudo service apache2 restart
Nileshsinh Rathod
  • 948
  • 1
  • 17
  • 37