php - 调用未定义的函数 pcntl_fork() ubuntu 服务器 apache

标签 php linux apache ubuntu pcntl

我对 pcnt_fork 有疑问

我是按照这个教程安装的

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, 

但是如果我查看 apache 错误日志我有 PHP fatal error :尚未调用未定义的函数 pcntl_fork()。!!

最佳答案

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

关于php - 调用未定义的函数 pcntl_fork() ubuntu 服务器 apache,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25892163/

相关文章:

php - 任何使用 DISTINCT 与此代码的想法

C++、全局变量和动态共享库

c - sk_buff 函数 skb_network_header() 和 skb_mac_header() 有什么作用?

php - htaccess Symfony2 将所有 *.php 页面(除了 app.php)重定向到 app.php

svn - 如何使用提交后 Hook 将提交的文件从 SVN 复制到 Web 目录?

c++ - 用于服务器编程的 wxwidgets (ftp apachelike)

php - 动态/递归 SQL 排序方式

php - 创建唯一的账单标识符

php - 如何在 codeigniter 中通过代理自动加载移动模板?

Django : Run Django at system boot