1

I have a symfony2 project and it throws this error on this code exactly

$c = new \SoapClient($objWidget->getLink() . '/ws.php?wsdl');

$objwidget is not empty and here is the error

Uncaught PHP Exception Symfony\Component\Debug\Exception\ClassNotFoundException: "Attempted to load class "SoapClient" from the global namespace. Did you forget a "use" statement?"

I tried use SoapClient at the top but still issue with SoapClient.

Garf365
  • 3,619
  • 5
  • 29
  • 41
  • check that the library is correctly installed http://php.net/manual/en/soap.installation.php – Matteo Sep 06 '16 at 12:09
  • thank you i enabled ssl soap in php.inf but now i have this error Uncaught PHP Exception SoapFault: "SOAP-ERROR: Parsing WSDL: Couldn't load from 'Adress' : failed to load external entity "Adress" – ayoub idelhoussain Sep 06 '16 at 12:19
  • ok now you can debug the situations as example as described here http://stackoverflow.com/a/21973010/2270041 – Matteo Sep 06 '16 at 12:28

1 Answers1

10

Soap not installet globally like other modules in PHP ! Jus install it ! default apt-get install php-soap for example if use php v5.6

sudo apt-get -y install php5.6-soap

or if your php v 7.1

sudo apt-get -y install php7.1-soap

e t.c.

then EXACTLY reload you server + CLEAR SymFony cache !!!

service apache2 reload

or

service apache2 restart
Vladimir Ch
  • 487
  • 1
  • 12
  • 26