bash PHP 警告:模块“soap”已加载到第 0 行的 Unknown 中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20390343/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP Warning: Module 'soap' already loaded in Unknown on line 0
提问by FabricioG
Hi, I have a problem with this error: PHP Warning: Module 'soap' already loaded in Unknown on line 0
嗨,我遇到了这个错误的问题:PHP 警告:模块 'soap' 已经加载在第 0 行的未知中
I am running vps on media temple. I got some instructions from their knowledge base and I followed them exactly as described. However to see if SOAP properly installed i went to the command line and ran "pear list" and this is what I get.
我在媒体神庙上运行 vps。我从他们的知识库中得到了一些说明,我完全按照描述的那样进行了操作。但是,要查看 SOAP 是否正确安装,我转到命令行并运行“梨列表”,这就是我得到的。
PHP Warning: Module 'soap' already loaded in Unknown on line 0
Installed packages, channel pear.php.net:
=========================================
Package Version State
Archive_Tar 1.3.11 stable
Console_Getopt 1.3.1 stable
PEAR 1.9.4 stable
Structures_Graph 1.0.4 stable
XML_Util 1.2.1 stable
[root@w8ld-gg7p ~]# rep extension /usr/local/lib/php.ini
-bash: rep: command not found
[root@w8ld-gg7p ~]#
Can anyone tell me what I'm doing wrong? First off it doesn't load SOAP in the installed packages list. Second I get that SOAP loaded in unkown error.
谁能告诉我我做错了什么?首先,它不会在已安装的软件包列表中加载 SOAP。其次,我在未知错误中加载了 SOAP。
I'm a newbie so any help would be greatly appreciated! Thank you!
我是新手,所以任何帮助将不胜感激!谢谢!
回答by ray
looks like you are loading the 'soap' module multiple times
instead of rep extension /usr/local/lib/php.ini
, you should use grep extension /usr/local/lib/php.ini
to search the modules loaded
看起来您正在多次加载“soap”模块而不是rep extension /usr/local/lib/php.ini
,您应该使用它grep extension /usr/local/lib/php.ini
来搜索加载的模块
If your ini is in different location, you need to find where is it.
如果你的ini在不同的位置,你需要找到它在哪里。
If you got PHP Warning from webpage, you can create a file with this as the content:
<?php phpinfo(); ?> in your browser, search for "Loaded Configuration File" and "Scan this dir for additional .ini files"
If you got PHP Warning when running PHP on the shell, run this on shell:
php -r "phpinfo();" | awk '/^Loaded|^Scan/ {print $NF}'
如果您从网页收到 PHP 警告,您可以创建一个文件,内容如下:
<?php phpinfo(); ?> in your browser, search for "Loaded Configuration File" and "Scan this dir for additional .ini files"
如果在 shell 上运行 PHP 时收到 PHP 警告,请在 shell 上运行:
php -r "phpinfo();" | awk '/^Loaded|^Scan/ {print $NF}'
depends on your installation, besides php.ini you may have ini files in php.d
取决于你的安装,除了 php.ini 你可能在 php.d 中有 ini 文件
for my redhat server:
对于我的红帽服务器:
; Note: packaged extension modules are now loaded via the .ini files
; found in the directory /etc/php.d; these are loaded by default.
; 注意:打包的扩展模块现在通过 .ini 文件加载
; 在目录 /etc/php.d 中找到;这些是默认加载的。
回答by Diale
Comment the extension=soap in one of the files:
在其中一个文件中注释 extension=soap:
e.g = in your Xampp (php.ini)
例如 = 在您的 Xampp (php.ini) 中
;extension=soap
回答by Sheyla
Go to: /etc/php/7.0/cli/conf.d/
转到:/etc/php/7.0/cli/conf.d/
Then:
然后:
ls | grep soap
Two files will be listed:
将列出两个文件:
- 20-soap.ini
- 40-soap.ini
- 20-soap.ini
- 40-soap.ini
Comment the extension=soap.so in one of the files:
在其中一个文件中注释 extension=soap.so:
;extension=soap.so
Done.
完毕。
If you're using Docker, comment the follow line in your /workspace/Dockerfle:
如果您使用的是 Docker,请在您的 /workspace/Dockerfle 中注释以下行:
echo "extension=soap.so" >> /etc/php/7.0/cli/conf.d/40-soap.ini
回答by vikas_hada
I had a similar problem for mbstring module. As we have two php.ini file one in apache2 and the other in cli You should uncomment (and hence load) in only one php.ini file the line ;extension=php_soap.dll(so) This should suppress the warning.
我对 mbstring 模块有类似的问题。由于我们有两个 php.ini 文件,一个在 apache2 中,另一个在 cli 中,您应该仅在一个 php.ini 文件中取消注释(并因此加载)该行 ;extension=php_soap.dll(so) 这应该会抑制警告。