PHP compilation and installation of pcntl extensions and troubleshooting methods

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

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.