Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to install the pcntl module without recompiling php? I'm trying to set this up on CentOS.

share|improve this question
up vote 2 down vote accepted

try to find module with yum command yum search pcntl

share|improve this answer

I haven't been able to get it working purely through a package manager, and yum search pcntl finds no matches, even after setting up some additional repositories.

I ended up finding one way that worked without reinstalling PHP entirely, though it does end up requiring a tiny bit of recompilation. A post found here mentions a somewhat straightforward way of compiling and enabling just the pcntl extension ( with a little editing and reformatting of the post):

Get your current php version (check phpinfo())
Get the sources for that version here:
Extract this file; you will got folder name like php5-x.x.x
Run following lines in terminal:

cd php5-x.x.x/ext/pcntl
cp modules/ /usr/lib/php/modules/
echo "" > /etc/php.d/pcntl.ini
restart apache

Note: if your /usr/lib/php/modules/ or /etc/php.d/ is not same
as this, you could try 'locate php/modules' or 'locate php.d'
share|improve this answer
This was extremely help to me and worked! Thank you very much. – A T Jan 21 '15 at 22:05

The pcntl module is in the php-cli package and can be installed with yum by using the following command:

sudo yum install php php-cli
share|improve this answer

Download your existing PHP version repository from (This is no matter where you have to download & extract. You can either download to local machine. Just want to copy ext/pcntl to somewhere in the server)

Extract downloaded folder (Example: /home/downloads/PHP_5.x.x/)

cd /home/downloads/PHP_5.x.x/ext/pcntl
cp modules/ /usr/local/lib/php/extensions/

[*This path is depend on your PHP installation/configurations. You can check the PHP extension path in php.ini or echo phpinfo(); ]

echo "" > /usr/local/lib/php.ini 

or Add the line "" to your php.ini

vim /usr/lib/php.ini

[*again depend on your PHP installation. You can find the php.ini path in locate php.ini or echo phpinfo(); ]

share|improve this answer
Without recompiling... wasn't a clue enough, was it? – Deer Hunter Feb 3 at 20:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.