Installing PCNTL manually in cPanel Server

PCNTL is Process Control support in PHP implements the Unix style of process creation, program execution,
signal handling and process termination.

Sample Error: when PCNTL requires and it is missing for some accounts
========
Fatal error: Call to undefined function pcntl_fork() in /path/blah.php on line 5
========
The PCNTL installation option is not available through cPanel by default, but we can install it manually without any issue.

The following simple steps would help you.

If you want to add –enable-pcntl to all PHP4 compilations, do this:

Create a file called: /var/cpanel/easy/apache/rawopts/all_php4
Add this to the file: –enable-pcntl

If you want to add –enable-pcntl to all PHP5 compilations, do this:

Create a file called: /var/cpanel/easy/apache/rawopts/all_php5
Add this to the file: –enable-pcntl

If you want to add –enable-pcntl to a specific version of PHP, say 5.2.6 , do this:

Create a file called: /var/cpanel/easy/apache/rawopts/PHP-5.2.6
Add this to the file: –enable-pcntl

Then rebuild apache and php using /scripts/easyapache

Once it is done confirm if pcntl is there either by creating a phpinfo page or from the php module list(php -m).

Leave a Reply

Your email address will not be published. Required fields are marked *