Reputation: 41
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
.
Upvotes: 1
Views: 11492
Reputation: 545
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
Upvotes: 10