我有一台CentOS 6,Apache 2.2,PHP 5.4的云服务器,我有一个Magento站点。 我尝试使用的Magento的WebService,并返回该错误:PHP SOAP和Magento WebService的错误
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://******.com/dev/index.php/api/soap/index/?wsdl=1' : failed to load external entity "http://******.com/dev/index.php/api/soap/index/?wsdl=1"
我在这里和谷歌搜索,我尝试在php.ini很多变化,但在所有的情况下,我没有成功。
我在某些情况下阅读这是服务器端的问题,对于错误的配置。
注¹:SOAP安装在服务器中,在phpinfo()中启用了SOAP。
注2:在另一台服务器上正常工作。
任何人有任何想法如何解决这个问题?
编辑:服务器使用WHM/CPanel,我用EasyApache安装Apache,PHP。并使用默认配置。
EDIT2:这仅仅是一个使用SOAP和错误它返回一个简单的示例代码:
代码:(此代码的第一行是一个9行,和第13行是“$ CLI =新SoapClient的( $ api_url_v1);“)
<?php
$api_url_v1 = "http://site.com/dev/api/soap/?wsdl=1";
$username = '*********';
$password = '*********';
$cli = new SoapClient($api_url_v1);
//retreive session id from login
$session_id = $cli->login($username, $password);
//call customer.list method
$result = $cli->call($session_id, 'customer.list', array(array()));
?>
错误:
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://site.com/dev/api/soap/?wsdl=1' : failed to load external entity "http://site.com/dev/api/soap/?wsdl=1" in /home/******/public_html/test_soap.php:13 Stack trace: #0 /home/******/public_html/test_soap.php(13): SoapClient->SoapClient('http://site...') #1 {main} thrown in /home/******/public_html/test_soap.php on line 13
CURL是否安装在服务器上? – iTom
是,“cURL支持:启用”。 ;) –
尝试https而不是? –