Because my PHP is compiled and installed, we will only introduce the compilation and installation of pcntl here. Decompress the php source code package to the pcntl directory in the folder. for example, I put it in the/data/soft/php5 folder: cd/data/soft/php5/ext/pcntl and then execute the following command in this directory (install php in/usr/local/php in my system)
Because my PHP is compiled and installed, we will only introduce the compilation and installation of pcntl here.
Decompress the php source code package to the pcntl directory in the folder. for example, I put it in the/data/soft/php5 folder:
cd /data/soft/php5/ext/pcntl
Then execute the following command in this directory (take php installed in/usr/local/php in my system as an example ):
Sudo ln-s/usr/local/php/bin/phpize/usr/local/bin/phpize (this operation is not required if a soft link has been established) phpize. /configure -- with-php-config =/usr/local/php/bin/php-config (please specify the location of the corresponding php-config in your system) makesudo make install
Possible error:
error: ‘PHP_FE_END’ undeclared here (not in a function)
Solution:
If the source code is incorrect, go to the php decompress Directory (in this example,/data/soft/php5 ).
sed -i 's|PHP_FE_END|{NULL,NULL,NULL}|' ./ext/**/*.csed -i 's|ZEND_MOD_END|{NULL,NULL,NULL}|' ./ext/**/*.c
Run make & make install again.
After pcntl is compiled and installed, a pcntl. so file is generated in the/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/directory.
Edit/etc/php. ini and add
extension=pcntl.so
Restart apache and test whether the installation is successful. the test code is as follows:
If a value is output, the installation is successful.
You can also use a simpler method to view the output value of phpinfo. if the following content is included, the installation is successful: