2014-09-17 1 views
0

J'ai un problème avec pcnt_forkAppel à pcntl_fork undefined function() serveur ubuntu apache

J'ai suivi ce tutoriel pour l'installation

instalation of 
pcntl 
$ mkdir /tmp/phpsource 
$ cd /tmp/phpsource 
$ apt-get source php5 
$ cd /tmp/phpsource/php5-*/ext/pcntl 
$ phpize 
$ ./configure 
$ make 
# then copy your module to php5 module-lib path (in my case:) 
# and create an .ini-file to enable the module for sapi after graceful restart. 

$ cp /tmp/phpsource/php5-*/modules/pcntl.so /usr/lib/php5/20090626/ 
$ echo "extension=pcntl.so" > /etc/php5/conf.d/pcntl.ini 

on php.ini you need to 
; This directive allows you to disable certain functions for security reasons. 
; It receives a comma-delimited list of function names. This directive is 
; *NOT* affected by whether Safe Mode is turned On or Off. 
; http://php.net/disable-functions 
;disable_functions pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, 

mais si je regarde dans le journal des erreurs apache je PHP Fatal error: Appelez la fonction non définie pcntl_fork() encore. !!

+2

avez-vous eu la chance de redémarrer votre serveur Web php.ini édition – Satya

+0

Voir aussi si le module apparaît dans phpinfo() –

+0

Vérifier http://stackoverflow.com/questions/209774/does -php-have-threading Je l'ai eu suite à François Bourgeois réponse (popen). – Ivan

Répondre

1

It is not possible to use the function 'pcntl_fork' when PHP is used as Apache module. You can only use pcntl_fork in CGI mode or from command-line.

Using this function will result in: 'Fatal error: Call to undefined function: pcntl_fork()'

http://php.net/manual/en/function.pcntl-fork.php

+0

alors comment puis-je paralléliser lorsque PHP est utilisé comme module Apache? – user3906040

+0

N'a aucune idée :) – YuS

Questions connexes