【 转】pcntl.so install for system’s PHP install

1 篇文章 0 订阅

pcntl.so install for system’s PHP install


Recently I needed to use pcntl_fork with a project and found that the stack I was using (MAMP) didn’t include support for pcntl.so by default. Fortunately it’s pretty easy to install on Lion.
Download the appropriate PHP source code from here. Since I’m using MAMP 2.0.5 and it comes with PHP 5.3.6, I had to go to the old releases page here.

curl http://museum.php.net/php5/php-5.3.6.tar.gz > php-5.3.6.tar.gz
tar xvfz php-5.3.6.tar.gz
cd php-5.3.6/ext/pcntl

Now for the build:

phpize
./configure
make
sudo make install

Now we need to add the pcntl.so to the php.ini …so open /private/etc/php.ini with your favorite editor and add the following line:

extension=pcntl.so

After saving, run the following command and it should output ‘pcntl’:

php -m | grep pcntl

Optional MAMP install:


Now lets copy pcntl.so to the MAMP extension folder:

cp /usr/lib/php/extensions/no-debug-non-zts-20090626/pcntl.so /Applications/MAMP//bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/

Edit the php.ini template for MAMP’s PHP install and add:

extension=pcntl.so

MAMP PHP Template

Restart MAMP… pcntl extension should now be installed for the system’s PHP and MAMP’s PHP.

Output of phpinfo(); will show this:

 

 

http://cyberpunx.com/2011/11/pcntl-so-on-osx-lion-and-mamp/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值