Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

3 Answers 3

up vote 2 down vote accepted

try to find module with yum command yum search pcntl

share|improve this answer

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

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

Your Answer

 
discard

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.