简体   繁体   中英

PHP Warning: Module 'soap' already loaded in Unknown on line 0

Hi, I have a problem with this error: PHP Warning: Module 'soap' already loaded in Unknown on line 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.

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.

I'm a newbie so any help would be greatly appreciated! Thank you!

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

If your ini is in different location, you need to find where is it.

  1. 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" 
  2. If you got PHP Warning when running PHP on the shell, run this on shell:

     php -r "phpinfo();" | awk '/^Loaded|^Scan/ {print $NF}' 

depends on your installation, besides php.ini you may have ini files in php.d

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.

Go to: /etc/php/7.0/cli/conf.d/

Then:

ls | grep soap

Two files will be listed:

  • 20-soap.ini
  • 40-soap.ini

Comment the extension=soap.so in one of the files:

;extension=soap.so

Done.

If you're using Docker, comment the follow line in your /workspace/Dockerfle:

echo "extension=soap.so" >> /etc/php/7.0/cli/conf.d/40-soap.ini

Comment the extension=soap in one of the files:

eg = in your Xampp (php.ini)

;extension=soap

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM