Home > Backend Development > PHP Tutorial > How to install PHP pcntl extension under linux

How to install PHP pcntl extension under linux

小云云
Release: 2023-03-20 20:12:02
Original
3720 people have browsed it

1. Download the same version of php (mine is php5.5.10, the one I downloaded is php5.5.10)

[root@CentOS6 lamp]# wget http://hk1.php.net/get/php-5.5.10.tar.gz
/from/this/mirror
Copy after login


If your php version is different, please change 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
Copy after login

3. Enter php/ext/pcntl/

[root@CentOS6 php-5.6.28]# cd ext/pcntl/
Copy after login

4. Execute the command phpize

[root@CentOS6 pcntl]# /usr/bin/phpize 
Configuring for:
PHP Api Version:         20131106
Zend Module Api No:      20131226
Zend Extension Api No:   220131226
Copy after login

5. Execute Configuration command php-config

[root@CentOS6 pcntl]# ./configure --with-php-config=/usr/bin/php-config
Copy after login

6, compile make && make install

[root@CentOS6 pcntl]# make && make install
Copy after login

may report an error:

Installing shared extensions: /usr/lib/php/modules /
make: Warning: Clock error detected. Your creation may be incomplete.

Solution:

Enter the php-5.6.28 directory

sed -i 's|PHP_FE_END|{NULL,NULL,NULL}|' ./ext/**/*.c
sed -i 's|ZEND_MOD_END|{NULL,NULL,NULL}|' ./ext/**/*.c
Copy after login

Recompile:

[root@CentOS6 pcntl]# make && make install
[root@CentOS6 pcntl]# make installInstalling shared extensions:    
 /usr/lib/php/modules/
Copy after login

7. Modify php.ini to support pcntl

[root@CentOS6 pcntl]# echo "extension=pcntl.so" >> /etc/php.ini
Copy after login

8. Check phpinfo() to see if there is a pcntl extension;

Related recommendations:
About pcntl_fork in php multi-process Detailed introduction

Share PHP-pcntl to implement multi-process code

PHP uses pcntl and libevent to implement Timer function

The above is the detailed content of How to install PHP pcntl extension under linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template