如何安装soap扩展?

How do I install soap extension?(如何安装soap扩展?)
本文介绍了如何安装soap扩展?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

如何安装 Soap?

我收到此错误:

致命错误:在第 16 行的/home/user/mysite.com/path/to/file.php 中找不到SoapClient"类

Fatal error: Class 'SoapClient' not found in /home/user/mysite.com/path/to/file.php on line 16

我在 DreamHost 中托管我的网站,他们不支持任何第三方安装.

I am hosting my site in DreamHost and they don't support any third-party installation.

更新:

我用这个脚本复制了 php.ini 文件:http://sxi.sabrextreme.com/dh-phpini

I copied the php.ini file with this script: http://sxi.sabrextreme.com/dh-phpini

我正在使用一个网站的 API,它说的是这样的:

I am using an API from a website and it says something like this:

#######################################################################
## You need to enable the following extensions in your PHP.ini file##
## php_openssl.dll ##
## php_soap.dll##
#######################################################################

这里是我的 php.ini 文件的扩展名列表:

and here are the list of extensions my php.ini file has:

extension=php_bz2.dll
;extension=php_cpdf.dll
;extension=php_curl.dll
;extension=php_dba.dll
;extension=php_dbase.dll
;extension=php_dbx.dll
;extension=php_exif.dll
;extension=php_fdf.dll
;extension=php_filepro.dll
;extension=php_gd2.dll
;extension=php_gettext.dll
;extension=php_ifx.dll
;extension=php_iisfunc.dll
;extension=php_imap.dll
;extension=php_interbase.dll
;extension=php_java.dll
;extension=php_ldap.dll
;extension=php_mbstring.dll
;extension=php_mcrypt.dll
;extension=php_mhash.dll
;extension=php_mime_magic.dll
;extension=php_ming.dll
;extension=php_mssql.dll
;extension=php_msql.dll
;extension=php_mysql.dll
;extension=php_oci8.dll
**extension=php_openssl.dll**
;extension=php_oracle.dll
;extension=php_pdf.dll
;extension=php_pgsql.dll
;extension=php_shmop.dll
;extension=php_snmp.dll
;extension=php_sockets.dll
;extension=php_sybase_ct.dll
;extension=php_tidy.dll
;extension=php_w32api.dll
;extension=php_xmlrpc.dll
;extension=php_xsl.dll
;extension=php_yaz.dll
;extension=php_zip.dll

问题是,在那里找不到扩展名 php_soap.dll.

The problem is, the extension php_soap.dll is not found there.

推荐答案

For Windows

  1. php.ini中找到extension=php_soap.dllextension=soap,去掉开头的注释分号线.最后检查conf.d目录下的soap.ini.

  1. Find extension=php_soap.dll or extension=soap in php.ini and remove the commenting semicolon at the beginning of the line. Eventually check for soap.ini under the conf.d directory.

重启你的服务器.

对于 Linux

Ubuntu:

PHP7

Apache

sudo apt-get install php7.0-soap 
sudo systemctl restart apache2

PHP5

sudo apt-get install php-soap
sudo systemctl restart apache2

OpenSuse:

PHP7

Apache

sudo zypper in php7-soap
sudo systemctl restart apache2

Nginx

sudo zypper in php7-soap
sudo systemctl restart nginx

这篇关于如何安装soap扩展?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

Subtract time in PHP(在 PHP 中减去时间)
Limit execution time of an function or command PHP(限制函数或命令 PHP 的执行时间)
How to sum N number of time (HH:MM Format)?(如何求和 N 次(HH:MM 格式)?)
How to get current time in milliseconds in PHP?(如何在 PHP 中以毫秒为单位获取当前时间?)
How to check if time is between two times in PHP(如何检查时间是否在 PHP 中的两次之间)
Convert number of minutes into hours amp; minutes using PHP(将分钟数转换为小时数分钟使用 PHP)