Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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: http://www.php.net/releases/
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
phpize
./configure
make
cp modules/pcntl.so /usr/lib/php/modules/
echo "extension=pcntl.so" > /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
1  
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

Check if this extension enabled.

php -m

or

php-fpm -m

If not exist, so you should it enable during build or build it as extension.

share|improve this answer

Download your existing PHP version repository from http://www.php.net/releases/ (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
phpize
./configure
make
cp modules/pcntl.so /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 "extension=pcntl.so" > /usr/local/lib/php.ini 

or Add the line "extension=pcntl.so" 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

protected by HopelessN00b Feb 25 at 20:50

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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