开发者

How do I enable the SOAP module for PHP?

How I enable PHP Soap module on my Mac OS开发者_Python百科X 10.5.8?

PHP is already installed but Soap module isn't configured when I've installed apache / php / mysql.


This link

http://web.archive.org/web/20150223153105/http://blog.pagebakers.nl/2008/12/17/installing-php-soap-extension-on-leopard-10-5-5

seems to be just about your issue.

I copy the link here:

While working a new project of mine, SoapSource: a soap datasource for Cakephp, I wanted to make use of PHP’s SOAP extension. As I figured out quickly the default install of PHP on Mac OS X Leopard isn’t compiled with the SOAP extension enabled. So I thought; that’s easy, just recompile PHP with the SOAP extension enabled.. However I encountered some serious problems. It appears to be impossible to compile a 64bit version of PHP on Mac OS, there’s some sort of bug with ‘libiconv’. So next idea, recompile Apache in 32bit, Mysql in 32bit and ofcourse PHP in 32bit… well again I didn’t succeed, so I reverted all my changes back to the original settings after a day of hard work and frustrations.

But then I found out you can compile dynamic extensions without recompiling your entire PHP installation. So I got SOAP running within 5 minutes using to following instructions:

Download the PHP source of the version your Mac is running, probably PHP-5.2.6, and extract the package.

cd /tmp

curl -O http://de3.php.net/distributions/php-5.2.6.tar.bz2

tar xjf php-5.2.6.tar.bz2

Then move to the expanded directory and execute the following commands.

cd php-5.2.6/

export LIBTOOLIZE=glibtoolize MACOSX_DEPLOYMENT_TARGET=10.5

cd ext/soap

phpize

Now we need to compile and install the extension.

MACOSX_DEPLOYMENT_TARGET=10.5 CFLAGS="-arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch x86_64 -g -Os -pipe" CXXFLAGS="-arch x86_64 -g -Os -pipe" LDFLAGS="-arch x86_64 -bind_at_load" ./configure

make

sudo make install

Now the extension has been compiled and installed, but you’ll probably need to do some more configuration before it will work.

Edit your php.ini, which is located in /private/etc/php.ini

Change the ‘extension_dir’ to ‘/usr/lib/php/extensions’ and enable the extension by adding this line ‘extension=soap.so’

Create a symbolic link to the soap extension

sudo ln -s /usr/lib/php/extensions/no-debug-non-zts-20060613/soap.so /usr/lib/php/extensions/soap.so

And finally restart apache for the changes to take effect

sudo apachectl restart

That’s it! you can now use the SOAP extensions. Please let me know if you have any comments or problems with this.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜