Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

After searching for hours to solve my problem and found nothing helpful I ask my first question here.

I want to compile and install php 5.3.17 cli with pcntl extension enabled on a Debian server. The installation was successfull but when I start php cli, the following error is displayed:

PHP Warning:  PHP Startup: Invalid library (maybe not a PHP library) 'pcntl.so' in Unknown\
on line 0

The following configure is used:

'./configure' '--prefix=/usr/share' '--datadir=/usr/share/php' '--bindir=/usr/bin' 
'--libdir=/usr/share' '--includedir=/usr/include' 
'--with-config-file-path=/etc/php5/cli' '--disable-cgi' '--enable-bcmath' 
'-- enable-inline-optimization' '--enable-mbstring' '--enable-mbregex' '--enable-pcntl'
'--enable-sigchild' '--enable-shmop' '--enable-sysvmsg' '--enable-sysvsem' 
'--enable-sysvshm' '--with-mysql' '--with-imap' '--with-imap-ssl' '--with-kerberos'

In the php.ini following options are set:

extension_dir=/usr/lib/php5/20090626/
extension=pcntl.so

I hope someone can help me.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I solved my problem now, with some help from this post stackoverflow answer how-to-enable-process-control-extension-pcntl-in-php-mamp.

First I switched to the source directory of the pcntl extension /src/php-5.3.17-cli/ext/pcntl.
There I ran the following commands in the shell:

phpize
./configure
make

Then the extension was created at /src/php-5.3.17-cli/ext/pcntl/modules and I copied it in the right directory with cp /src/php-5.3.17-cli/ext/pcntl/module/pcntl.so /usr/lib/php5/20090626/.

Now the extension works for my php-cli installation.
Thank you @terdon for your answer it pushed me a bit in the right direction.

share|improve this answer

You should have a file called pcntl.so in the modules subdirectory of the directory where you built php. Copy that to /usr/lib/php5/20090626/ :

sudo cp PHP_BUILD_DIR/modules/pcntl.so /usr/lib/php5/20090626/

Obviously, change PHP_BUILD_DIR to the directory where you compiled php.

share|improve this answer
    
After finishing the build of php the pcntl.so extension was created at /usr/share/extensions/no-debug-non-zts-20090626/ and I copied it to /usr/lib/php5/20090626/. When the pcntl.so file is not in the directory the following error message occurse: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626/pcntl.so' - usr/lib/php5/20090626/pcntl.so: cannot open shared object file: No such file or directory in Unknown on line 0 So I think the file is at the right place. –  And-y Oct 10 '12 at 7:49

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.