How to install PHP pcntl extensions under Linux

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.