1, download an identical version of PHP (My is php5.5.10, I am under the php5.5.10)
[Root@centos6 lamp]# wget Http://hk1.php.net/get/php-5.5.10.tar.gz/from/this/mirror
If your PHP version is different please modify it to wget http://hk1.php.net/get/php-x.x.xx.tar.gz/from/this/mirror
2. Unzip PHP:
[Root@centos6 lamp]# TAR-ZXVF Mirror
3. Enter php/ext/pcntl/
[ROOT@CENTOS6 php-5.6.28]# CD ext/pcntl/
4. Execute Command phpize
[ROOT@CENTOS6 pcntl]#/usr/bin/phpize configuring for:php API Version: 20131106Zend Module API No: 20131226Zend Extension Api No: 220131226
5. Execute configuration Command php-config
[Root@centos6 pcntl]#./configure--with-php-config=/usr/bin/php-config
6. Compile make && make install
[Root@centos6 pcntl]# make && make install
Possible error:
Installing Shared extensions:/usr/lib/php/modules/
Make: Warning: A clock error was detected. Your creation may not be complete.
Workaround:
Enter the php-5.6.28 directory
Sed-i ' s| php_fe_end| {null,null,null}| ' ./ext/**/*.csed-i ' s| zend_mod_end| {null,null,null}| ' ./ext/**/*.c
Recompile:
[Root@centos6 pcntl]# make && make install[root@centos6 pcntl]# make installinstalling shared extensions: / usr/lib/php/modules/
7, modify php.ini support Pcntl
[Root@centos6 pcntl]# echo "extension=pcntl.so" >>/etc/php.ini
8, check phpinfo (), whether there is pcntl extension;
Related recommendations:
A detailed introduction to Pcntl_fork in PHP multi-process
Share Php-pcntl implement multi-process code
PHP uses PCNTL and libevent to implement timer functions