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

716

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
[[email protected] ~]# rep extension /usr/local/lib/php.ini
-bash: rep: command not found
[[email protected] ~]# 

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!

557

Answer

Solution:

Comment the extension=soap in one of the files:

e.g = in your Xampp (php.ini)

;extension=soap
927

Answer

Solution:

looks like you are loading the 'soap' module multiple times instead ofrep extension /usr/local/lib/php.ini, you should usegrep 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.

519

Answer

Solution:

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
635

Answer

Solution:

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.

People are also looking for solutions to the problem: php - Replace default_controller with different variable name in Codeigniter

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.