That's much the question. I have PHP 5.2.9 on Apache and I cannot upgrade PHP. Is there a way for me to enable SOAP in PHP 5.2.9? The PHP manual did not help at all when it said, "To enable SOAP support, configure PHP with --enable-soap ." How do I configure?
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
In case that you have Ubuntu in your machine, the following steps will help you:
Open your terminal and paste: sudo apt-get install php-soap.
Restart your apache2 server in terminal : service apache2 restart.
To check use your php test file again to be seems like mine in step 1.
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:
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:
or in RHEL/Fedora you can search with:
There are usually two PHP SOAP packages available to you, usually
php-soap
andphp-nusoap
.php-soap
is typically what you get with configuring PHP with--enable-soap
.In Ubuntu/Debian you can install with:
Or in RHEL/Fedora you can install with:
After the installation, you might need to place an ini file and restart Apache.
As far as your question goes: no, if activating from
.ini
is not enough and you can't upgrade PHP, there's not much you can do. Some modules, but not all, can be added without recompilation (zypper install php5-soap
,yum install php-soap
). If it is not enough, try installing some PEAR class for interpreted SOAP support (NuSOAP, etc.).In general, the double-dash
--switches
are designed to be used when recompiling PHP from scratch.You would download the PHP source package (as a compressed
.tgz
tarball, say), expand it somewhere and then, e.g. under Linux, run the configure scriptThe
configure
command used by your PHP may be shown withphpinfo()
. Repeating it identical should give you an exact copy of the PHP you now have installed. Adding--enable-soap
will then enable SOAP in addition to everything else.That said, if you aren't familiar with PHP recompilation, don't do it. It also requires several ancillary libraries that you might, or might not, have available -
freetype
,gd
,libjpeg
,XML
,expat
, and so on and so forth (it's not enough they are installed; they must be a developer version, i.e. with headers and so on; in most distributions, havinglibjpeg
installed might not be enough, and you might needlibjpeg-dev
also).I have to keep a separate virtual machine with everything installed for my recompilation purposes.