Adding pcntl_fork support on a cpanel server

A php application on a cpanel server kept throwing this:

Fatal error: Call to undefined function pcntl_fork() in /path/blah.php on line 5

The fix requires recompiling php with -enable-pcntl Fortunately cpanel offers the Easy Apache script. The bad part is that it doesn’t have an option for pcntl. So you have to specify it as a custom compile time option. Edit (or create - for PHP5) and add /var/cpanel/easy/apache/rawopts/all_php5

-enable-pcntl

On one line

Then rebuild Easy Apache.