SOAP-ERROR: Parsing WSDL: Couldn’t load from … : failed to load external entity …

I had written some code using Magento API, it worked fine on my local machine but when I transferred the same code to my linux server I got the following error:

SOAP-ERROR: Parsing WSDL: Couldn't load from '' : failed to load external entity ""

When I opened the URL ‘’  directlty in my browser, it displayed the wsdl file as expected.

The cause of the error is: PHP SoapServer needs to read the wsdl to know which methods are exposed, but when it tries to access the wsdl using instead of localhost it is not able to do so. So, its some network configuration error.

To confirm the same, connect to your server via SSH and try running the following:


If the above command does not display the wsdl file but gives some error then its a network configuration error.

I was using a Centos server and my problem was solved by adding an entry for the domain in the ‘hosts’ file ‘/etc/hosts’ as follows:

In my case my magento application was on the same server on which I was using the Magento API.

If your Magento code is on one server and you are trying to call the Magneto API from another server then you can check your firewall rules.


Leave a Comment

Back to top