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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

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

Dreamweaver Mac version
Visual web development tools

Notepad++7.3.1
Easy-to-use and free code editor