Magento Uncaught SoapFault exception: [0] Unable t

2019-08-03 18:04发布

问题:

I am so lost right now. I am trying to use Soap client and I get the following error

Uncaught SoapFault exception: [0] Unable to load Soap extension on the server in /opt/local/apache2/htdocs/code/import.php

inside of import.php

import.php

$client = new SoapClient('http://mymagentowebsite.com/api/soap/?wsdl');
$session = $client->login('api_master', 'api123');

When I got to my phpinfo, I am able to see my soap client enabled

I am using Macports and I did install the soap port extension as well

below is what i found in my php.ini

extension=php_soap.dll
[soap]
; Enables or disables WSDL caching feature.
; http://php.net/soap.wsdl-cache-enabled
soap.wsdl_cache_enabled=1

; Sets the directory name where SOAP extension will put cache files.
; http://php.net/soap.wsdl-cache-dir
soap.wsdl_cache_dir="/tmp"

; (time to live) Sets the number of second while cached file will be used
; instead of original one.
; http://php.net/soap.wsdl-cache-ttl
soap.wsdl_cache_ttl=86400

; Sets the size of the cache limit. (Max. number of WSDL files to cache)
soap.wsdl_cache_limit = 5

What am I doing wrong ?

回答1:

I've figured it out. My local machine had the SOAP CLIENT and SERVER extension installed but the server I was calling to didn't. I had to go to the remote server and install the soap extension. I got my source from the following.

I was confused because I thought the error was referring to my local machine, but it was referring to my remote machine.

PHP SOAP fatal error message