user16948
user16948

Reputation: 4951

SOAP-ERROR: Parsing WSDL: Couldn't load from url

While executing the following line I get this error:

$client = new soapclient('https://example.com/xxx/pgw?wsdl=xyz.wsdl');

Error:

SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:8080/xxx/pgw?wsdl=xyz.wsdl' : failed to load external entity "http://localhost:8080/xxx/pgw?wsdl=xyz.wsdl" in SoapClient->SoapClient() (line 39 of /var/www/.../myscript.php).

I have checked the URL in my browser and that's ok. What can cause the error?

Upvotes: 2

Views: 4068

Answers (1)

DM Graves
DM Graves

Reputation: 819

I ran across this same issue today, after several hours and after trying file_get_contents on my WSDL URL, I noticed that I was getting a permission denied error in my apache error log. I figured out that SELinux was the culprit. I believe by default, SELinux blocks httpd from making its own network requests (at least on Fedora).

The fix was: setsebool -P httpd_can_network_connect 1, which then allowed Apache to connect to the remote service (it worked for both SSL and non-SSL requests).

Upvotes: 3

Related Questions