mac下安装pcntl

 Now you need to find out what version of PHP is installed on OSX

$ php -v
PHP 5.3.10 with Suhosin-Patch (cli) (built: Feb 20 2012 22:55:53) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

and then get the source code for that version

$ curl -O http://us.php.net/distributions/php-5.3.10.tar.gz

When the download have finished, you should unpack, find the PCNTL extension, phpize, configure, make and then make install

$ tar -xzvf php-5.3.10.tar.gf 
$ cd php-5.3.10/ext/pcntl
$ phpize
$ ./configure
$ make
$ sudo make install
 

sudo /Applications/XAMPP/xamppfiles/bin/phpize

sudo MACOSX_DEPLOYMENT_TARGET=10.7 CFLAGS="-arch i386 -arch x86_64 -g -Os -pipe -no-cpp-precomp" CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe" LDFLAGS="-arch i386 -arch x86_64 -bind_at_load" ./configure —enable-pcntl --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config

sudo make && sudo make install

 
 
 
 
我是真的不想从新编译,安装,由于我不知道会出现什么问题,并且麻烦,我就是不肯意。
后来找了一哥们跟我碰到的状况同样,http://ubuntuforums.org/showthread.php?t=549953,上面仍是说,能够不从新编译php5就能够增长pcntl这个模块,用的仍是phpize这个命令,并且他老大花了3个小时搞定……
那我就百度一下,phpize这个命令到底怎么搞,又有一哥们也碰到了我这样的问题,http://www.linuxsir.org/bbs/showthread.php?p=1763019,直接apt-get install php5-dev就能够了,这哥们从发帖求助到本身解决用了9分钟,仍是07年的事情。
果真apt-get install php5-dev以后就有了phpize命令,而后按照第一个老外哥们的方法,解压php源代码以后,cd php/etc/pcntl,phpize,./configure,make,在module文件夹下就生成了pcntl.so文件,将其复制到php的extension_dir中,在php.ini文件中添加extension=pcntl.so,重启apache,搞定!