Fatal error: Class 'SoapClient' not found

2020-01-23 17:02发布

I'm trying a simple web service example and I get this error even though I uncommented extension=php_soap.dll in the php.ini file:

Fatal error: Class 'SoapClient' not found in C:\Program Files (x86)\EasyPHP-5.3.9\www\server.php on line 2

9条回答
仙女界的扛把子
2楼-- · 2020-01-23 17:29

You have to inherit nusoap.php class and put it in your project directory, you can download it from the Internet.

Use this code:

require_once('nusoap.php');
查看更多
Bombasti
3楼-- · 2020-01-23 17:38

For AWS (RHEL):

sudo yum install php56-soap

(56 here is 5.6 PHP version - put your version here).

查看更多
何必那么认真
4楼-- · 2020-01-23 17:39

For Docker* add this line:

RUN apt-get update && \
    apt-get install -y libxml2-dev && \
    docker-php-ext-install soap

*: For debian based images, ie. won't work for alpine variants.

查看更多
登录 后发表回答