How to enable --enable-soap in php on linux?

Much of the question. I have PHP 5.2.9 on Apache and I cannot upgrade PHP. Is there a way to enable SOAP in PHP 5.2.9? The PHP manual did not help when it said: "To enable SOAP support, configure PHP with --enable-soap." How to setup?

+45
soap linux php fedora
Jul 20 2018-12-17T00:
source share
3 answers

Getting SOAP work usually does not require compiling PHP from source code. I would recommend trying this only as a last resort.

For a good measure, check what your phpinfo says, if anything, about SOAP extensions:

$ php -i | grep -i soap 

to make sure this PHP extension is missing.

Assuming you don't see anything about SOAP in phpinfo, see what PHP SOAP packages might be available to you.

On Ubuntu / Debian, you can search using

 $ apt-cache search php | grep -i soap 

or in RHEL / Fedora you can search using

 $ yum search php | grep -i soap 

Usually two available SOAP PHP packages are available for you, usually php-soap and php-nusoap . php-soap , usually you get with PHP setup with --enable-soap .

On 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 installation, you may need to place the ini file and restart Apache.

+90
Jul 20 '12 at 18:27
source share

As for your question: no, if activating with .ini not enough, and you cannot upgrade PHP, you cannot do this. Some modules, but not all, can be added without recompilation ( zypper install php5-soap , yum install php-soap ). If this is not enough, try installing some PEAR class for interpreted SOAP support (NuSOAP, etc.).

In general, the double dash --switches intended to be used when recompiling PHP from scratch.

You download the original PHP package (e.g. compressed tar2 t24), decompose it somewhere, and then, for example. under Linux run configure script

 ./configure --prefix ... 

The configure command used by your PHP can be shown with phpinfo() . Repeating it identically should give you the exact copy of PHP that you just installed. Adding --enable-soap will then enable SOAP in addition to everything else.

However, if you are not familiar with recompiling PHP, do not. It also requires several auxiliary libraries that you could or could have - freetype , gd , libjpeg , XML , expat , etc. Etc. (This is not enough., They must be a version of the developer, that is, with headers, etc., in most distributions, installing libjpeg may not be sufficient, and you may also need libjpeg-dev ).

I need to keep a separate virtual machine with everything that was installed for my recompilation purposes.

+6
Jul 20 2018-12-18T00:
source share

If you have Ubuntu on your computer, the following steps will help you:

  • First check your php testing file if you have soap (client / server) or not using phpinfo (); and check the results in the browser. If you have this, it will look like this (unless you go to step 2):

enter image description here

  1. Open your terminal and paste it: sudo apt-get install php-soap.

  2. Restart apache2 server in terminal: restart apache2 service.

  3. To verify that your php test file again looks like mine in step 1.

0
Jul 06 '17 at 11:45
source share



All Articles