Symfony2 using SoapClient

空扰寡人 提交于 2020-01-03 02:46:12

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/39347967/symfony2-using-soapclient

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!