1

I'm using PHP Version 8.0.14, and Ubuntu 20.04.1 on my AWS EC2.

My Loaded Configuration File is located here /etc/php/8.0/fpm/php.ini

and in my php.ini i have soap enabled

extension=soap (removed the ;)

Even after restarting my Apache i still get the error Class "SoapClient" not found.

I thought maybe i didn't have Soap installed, so i tried sudo apt-get install php-soap and got this

Reading package lists... Done
Building dependency tree
Reading state information... Done
php-soap is already the newest version (2:8.1+92+ubuntu20.04.1+deb.sury.org+2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

in my php code, the Soap is called like this

use SoapClient;

class bla {

 function abc() {
   $x = new SoapClient('https://url/?wsdl'); 
 }
}

any idea how to fix this? Thank you.

Shaho
  • 55
  • 1
  • 9
  • 1
    [`apt install -y php8.0-soap`](https://stackoverflow.com/a/65051810/5897602) – Jaquarh Jan 21 '22 at 19:05
  • @Jaquarh got it! thank you – Shaho Jan 21 '22 at 19:08
  • 1
    Note: on Ubuntu 22.04, `php8.0-soap` is broken and not installed; you will need to add a PPA to get the package. I recommend using Ondrej's PHP PPA, which is the 'gold standard' of PHP PPAs: `add-apt-repository ppa:ondrej/php` – Gwyneth Llewelyn May 14 '22 at 13:55

0 Answers0