How do I enable --enable-soap in php on linux?
Getting SOAP working usually does not require compiling PHP from source. I would recommend trying that only as a last option.
For good measure, check to see what your phpinfo says, if anything, about SOAP extensions:
$ php -i | grep -i soap
to ensure that it is the PHP extension that is missing.
Assuming you do not see anything about SOAP in the phpinfo, see what PHP SOAP packages might be available to you.
In Ubuntu/Debian you can search with:
$ apt-cache search php | grep -i soap
or in RHEL/Fedora you can search with:
$ yum search php | grep -i soap
There are usually two PHP SOAP packages available to you, usually php-soap
and php-nusoap
. php-soap
is typically what you get with configuring PHP with --enable-soap
.
In Ubuntu/Debian you can install with:
$ sudo apt-get install php-soap
Or in RHEL/Fedora you can install with:
$ sudo yum install php-soap
After the installation, you might need to place an ini file and restart Apache.
enable SOAP on PHP
You may need to make sure the PHP SOAP package is installed. Try running yum install php-soap
as root.
Edit: Adapted from this excellent answer to a similar question:
run this:
yum --enablerepo=webtatic install php-soap
this tells yum to get the packages from webtatic repository (in addition to system configured repositories). If you want webtatic among system enabled repositories, run:
rpm --import http://repo.webtatic.com/yum/RPM-GPG-KEY-webtatic-andy
yum --enablerepo=webtatic install webtatic-release
How do I install soap extension?
For Windows
Find
extension=php_soap.dll
orextension=soap
in php.ini and remove the commenting semicolon at the beginning of the line. Eventually check forsoap.ini
under the conf.d directory.Restart your server.
For 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
Enable soap for php in docker container
You will need to install libxml2-dev as part of your dockerfile, the image is kept to a minimum and doesn't include all of the bits needed by every module. Although the image may have the main package, the -dev package includes the components needed to compile other modules which rely on it...
RUN apt-get update && \
apt-get install -y libxml2-dev
(From https://github.com/docker-library/php/issues/315)
Just to make it clear - the command
RUN docker-php-ext-install soap
will then run successfully to install the soap library.
Related Topics
How to Refresh a Page When a Database Is Updated
Validating Us Phone Number with PHP/Regex
Utf-8 Encoding for Subject in Contact Form Email
Oauth Implementation in Netsuite Using PHP
How to Pass Value from One PHP Page to Another Using Session
Phpmailer - the Following Smtp Error: Data Not Accepted
How to Include a PHP.Ini File in Another PHP.Ini File
Laravel Model Callbacks After Save, Before Save, etc
PHP Include Causes White Space at the Top of the Page
PHP String Interpolation Syntax
Pdo SQLite Could Not Find Driver... PHP File Not Processing
Array to Object and Object to Array in PHP - Interesting Behaviour
Convert Hex Color to Rgb Values in PHP
Php: Check for Duplicate Values in a Multidimensional Array
Leverage Browser Caching, How on Apache or .Htaccess
Determine If Business Is Open/Closed Based on Business Hours