1

I am trying to get products using soap api. But I am getting below error:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://example.com/index.php/api/v2_soap/?wsdl=1' : failed to load external entity "https://example.com/index.php/api/v2_soap/?wsdl=1" in /var/www/example/soap.php:36 Stack trace: #0 /var/www/example/soap.php(36): SoapClient->SoapClient('https://example...') #1 {main} thrown in /var/www/example/soap.php on line 36

I am using below code:

$client = new SoapClient('https://example.com/index.php/api/v2_soap/?wsdl=1');

var_dump($client); die('test');

Also, I have reinstalled openssl and ca-certificates on the server.

Can anyone help please?

4
  • Check if soap is enabled in the server or not? Dec 19, 2018 at 8:54
  • @SukumarGorai, Soap is enabled Dec 19, 2018 at 9:21
  • Are you using live server or in local? Dec 19, 2018 at 10:09
  • It is live server Dec 19, 2018 at 10:18

1 Answer 1

1

I had the same issue in aws server with ubuntu OS.

I have resolved the issue by applying following lines.

Add the below lines to your working php.ini file:

verify_peer = false
verify_peer_name = false
allow_self_signed = false

Just above the below lines

; Local Variables:
; tab-width: 4
; End:

You can see the above lines at the end of the php.ini file.

Update these are restart the apache. It should work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.