phppcntlprocess-control

PCNTL not enabled in php even after compiling


I just compiled my PHP with --enable-pcntl, but when I try to access the process control functions in PHP, I get:

Fatal error: Call to undefined function pcntl_fork()

Am I missing something? My apache is not compiled with prefork. Is that required for this to work?

Full PHP compile flags:

'./configure' 
'--prefix=/usr/local/lib64/php' 
'--with-libdir=lib64' 
'--with-apxs2=/usr/local/lib64/apache2/bin/apxs' 
'--with-mysql' 
'--enable-xml' 
'--with-curl' 
'--with-gd' 
'--enable-soap' 
'--with-xmlrpc' 
'--with-mysqli' 
'--with-unixODBC=/usr/' 
'--with-pdo-mysql' 
'--with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib' 
'--with-mcrypt' 
'--enable-mbstring' 
'--with-zlib=/usr' 
'--with-openssl' 
'--enable-sockets' 
'--with-mssql=/usr/local' 
'--enable-ftp' 
'--enable-zip' 
'--enable-pcntl' 

Apache modules:

core mod_so http_core event mod_authn_file mod_authn_core mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_core mod_access_compat mod_auth_basic mod_reqtimeout mod_filter mod_mime mod_log_config mod_env mod_headers mod_setenvif mod_version mod_unixd mod_dav mod_status mod_autoindex mod_dav_fs mod_dir mod_alias mod_rewrite mod_php5 

EDIT: Maybe I wasn't clear enough. I will not be using pcntl function from the web server. I would like to reiterate, that none of my pcntl functions are working from the command line either. Any idea on that?


Solution

  • Make sure you don't have multiple copies of PHP, since they can be configured in different ways.