pcntl extension can support multi-threaded operation of php (linux only)
Originally, you need to recompile PHP and add --enable-pcntl to the configure prompt later
Since my php is installed using yum, I cannot use the above Method
The following introduces a way to dynamically add extensions to phpize
1. First look at the directory where the phpize command is located (ps: my directory/usr/bin/phpize)
If not found, execute the installation
yum install php53_devel (ps:请注意自己的版本)
After installation is completed. The phpize command will be generated
2. Go to php.net to download the corresponding version of the php source file
Let’s take php-5.3.17 as an example. After unzipping, enter the corresponding module
cd ext/pcntl #先执行phpize /usr/bin/phpize ./configure --with-php-config=/usr/bin/php-config (ps:请正确的指定php-config的目录) #编译、安装 make && make install
At this time An error occurred
./configure compiled normally, but make error
error: 'PHP_FE_END' undeclared here (not in a function)
Solution:
There is an error in the source code, enter the php-5.3.17 directory
sed -i 's|PHP_FE_END|{NULL,NULL,NULL}|' ./ext/**/*.c
sed -i 's|ZEND_MOD_END|{NULL,NULL,NULL}|' ./ext/**/*.c
Re-make && make install
3. It will be generated after compilation is completed A pcntl.so file was created. Edit /etc/php.ini in the php model directory and add
extension=pcntl.so
4. Restart apache
service httpd restart
5. Test whether the installation is successful
<?php echo pcntl_fork(); ?>
Output: 23165
For more articles related to adding pcntl extension to php in Linux system, please pay attention to PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Chinese version
Chinese version, very easy to use

Dreamweaver CS6
Visual web development tools

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

WebStorm Mac version
Useful JavaScript development tools
