在Ubuntu PHP启用PCNTL - 测试失败(Enable PCNTL in Ubuntu

2019-08-05 03:22发布

我需要怎样的帮助:在Ubuntu PHP启用PCNTL。

$ mkdir /tmp/phpsource
$ cd /tmp/phpsource


$ wget http://museum.php.net/php5/php-5.3.2.tar.gz
$ tar xvf php-5.3.2.tar.gz
$ cd php-5.3.2/ext/pcntl


$ phpize   -bash: phpize: command not found

一切都很好,直到我试图运行phpize! 然后我得到的错误“-bash:phpize:找不到命令”? 有任何想法吗?

UPDATE跑:

$ sudo apt-get update

然后跑去:

$ sudo apt-get install php5-dev

与尼克的帮助下,我成功地完成该过程。 但是,“使测试”失败???

$ phpize
$ ./configure
$ make

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

$ make test - FAILED!

HELP:我输入 '回响“扩展名= pcntl.so> /etc/php5/conf.d/pcntl.ini' 而不是'回声 “延长= pcntl.so”> /etc/php5/conf.d/pcntl.ini “我第一次跑这个。有问题吗?

---------------------------------使测试错误消息------------- -------------------------

PHP Deprecated: Comments starting with '#' are deprecated in /tmp/phpsource/php-5.3.2/ext/pcntl/tmp-php.ini on line 1850 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /tmp/phpsource/php-5.3.2/ext/pcntl/tmp-php.ini on line 1852 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /tmp/phpsource/php-5.3.2/ext/pcntl/tmp-php.ini on line 1850 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /tmp/phpsource/php-5.3.2/ext/pcntl/tmp-php.ini on line 1852 in Unknown on line 0
PHP Warning: Module 'pcntl' already loaded in Unknown on line 0

Warning: Module 'pcntl' already loaded in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /tmp/phpsource/php-5.3.2/ext/pcntl/tmp-php.ini on line 1850 in Unknown on line 0
PHP Deprecated: Comments starting with '#' are deprecated in /tmp/phpsource/php-5.3.2/ext/pcntl/tmp-php.ini on line 1852 in Unknown on line 0
PHP Warning: Module 'pcntl' already loaded in Unknown on line 0

Warning: Module 'pcntl' already loaded in Unknown on line 0

=====================================================================
PHP : /usr/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.3.2-1ubuntu4.18
ZEND_VERSION: 2.3.0
PHP_OS : Linux - Linux lvps217-8-253-63.vps.webfusion.co.uk 2.6.32-042stab068.8 #1 SMP Fri Dec 7 17:06:14 MSK 2012 x86_64
INI actual : /tmp/phpsource/php-5.3.2/ext/pcntl/tmp-php.ini
More .INIs :
CWD : /tmp/phpsource/php-5.3.2/ext/pcntl
Extra dirs :
VALGRIND : Not used
=====================================================================
TIME START 2013-01-02 23:05:56
=====================================================================
FAIL Test pcntl wait functionality [tests/001.phpt]
FAIL pcntl: pcntl_sigprocmask(), pcntl_sigwaitinfo(), pcntl_sigtimedwait() [tests/002.phpt]
FAIL pcntl: SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK [tests/003.phpt]
FAIL Bug #47566 (return value of pcntl_wexitstatus()) [tests/bug47566.phpt]
FAIL pcntl_alarm() [tests/pcntl_alarm.phpt]
FAIL pcntl_exec() [tests/pcntl_exec.phpt]
FAIL pcntl_exec() 2 [tests/pcntl_exec_2.phpt]
FAIL pcntl_exec() 3 [tests/pcntl_exec_3.phpt]
FAIL Test function pcntl_fork() by calling it with its expected arguments [tests/pcntl_fork_basic.phpt]
FAIL Test function pcntl_fork() by testing the process isolation in the forking hierarchy father -> son -> grandson where father can not knows his grandson [tests/pcntl_fork_variation.phpt]
FAIL pcntl_signal() [tests/pcntl_signal.phpt]
FAIL pcnt_signal_dispatch() [tests/pcntl_signal_dispatch.phpt]
FAIL pcntl_wait() [tests/pcntl_wait.phpt]
FAIL Closures as a signal handler [tests/signal_closure_handler.phpt]
=====================================================================
TIME END 2013-01-02 23:05:59

=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 44
---------------------------------------------------------------------

Number of tests : 14 14
Tests skipped : 0 ( 0.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 14 (100.0%) (100.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)
---------------------------------------------------------------------
Time taken : 3 seconds
=====================================================================

=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
Test pcntl wait functionality [tests/001.phpt]
pcntl: pcntl_sigprocmask(), pcntl_sigwaitinfo(), pcntl_sigtimedwait() [tests/002.phpt]
pcntl: SIG_BLOCK, SIG_UNBLOCK, SIG_SETMASK [tests/003.phpt]
Bug #47566 (return value of pcntl_wexitstatus()) [tests/bug47566.phpt]
pcntl_alarm() [tests/pcntl_alarm.phpt]
pcntl_exec() [tests/pcntl_exec.phpt]
pcntl_exec() 2 [tests/pcntl_exec_2.phpt]
pcntl_exec() 3 [tests/pcntl_exec_3.phpt]
Test function pcntl_fork() by calling it with its expected arguments [tests/pcntl_fork_basic.phpt]
Test function pcntl_fork() by testing the process isolation in the forking hierarchy father -> son -> grandson where father can not knows his grandson [tests/pcntl_fork_variation.phpt]
pcntl_signal() [tests/pcntl_signal.phpt]
pcnt_signal_dispatch() [tests/pcntl_signal_dispatch.phpt]
pcntl_wait() [tests/pcntl_wait.phpt]
Closures as a signal handler [tests/signal_closure_handler.phpt]

有任何想法吗!?! 卡尔

Answer 1:

下面是我在Ubuntu 12.04已经找到:

  • 检查你的php.ini的pnctl功能被禁用。

     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 
  • 的phpinfo报告功能已经加载,但不会实际没有把pcntl.ini文件到/etc/php5/conf.d工作。

可悲的是,这会导致“模块已加载”错误/etc/cron.d中的每一次PHP会话清理的cron揭开序幕,但没有这两件代替PCNTL将不起作用,到目前为止我还没有找到一个很好的解决禁用“已加载”的错误。 它的凌乱,和丑陋,修建垃圾我的根的邮件,当我能找到一个解决方案,我将它张贴。 我只在12.04跑这么远到这个问题。

UPDATE

我砍死我的/ usr / lib目录/ PHP5 / maxlifetime脚本文件,停止与pnctl错误的垃圾邮件(PHP警告:模块“了pcntl”已装入未知在线0)。 这里是我的编辑 - 我在“E_DEPRECATED”行专门添加到安静的消息。

8号线:

    cur=$(php5 -c /etc/php5/${sapi}/php.ini -d "error_reporting='E_ALL & ~E_DEPRECATED'" -r 'print ini_get("session.gc_maxlifetime");' 2> /dev/null)


Answer 2:

有这样一些步骤:(我的操作系统是debian7.2 XFCE 86)。

1:我安装了pcntl这样

#mkdir php
#cd php 
#apt-get source php5 
#cd php5-5.4.4/ext/pcntl
#phpize
#./configure
#make
#echo "extension=pcntl.so" > /etc/php5/mods-available/pcntl.ini
#ln -s /etc/php5/mods-available/pcntl.ini /etc/php5/conf.d/pcntl.ini

2:当重启nginx的或的Apache2,PHP的得到一个警告。

“PHP警告:模块‘了pcntl’已装入未知在线0”

3:所以我

“室射频/etc/php5/mods-available/pcntl.ini和/etc/php5/conf.d/pcntl.ini”

4:编辑 “的php.ini” 文件。

 a.apache2, it's in "/etc/php5/apache2/php.ini" b.cgi like nginx,it's in "/etc/php5/cgi/php.ini" 

使

"disable_functions = pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited..."
comments, add  " ; "  in front of "disable_functions".

重新启动服务器,并警告gone.good运气。



Answer 3:

在我的dev的机器与Ubuntu 12.10(及更早版本太)了pcntl是/已经启用。

$ php -m | grep pcntl
pcntl

我想这就是问题:

PHP警告:模块“了pcntl”已装入未知在线0

因此,只要不重新安装。



Answer 4:

我需要重新启动服务器! 现在,它的作品! 卫生署..感谢每个人的投入。



Answer 5:

在Ubuntu 15.04中,PCNTL安装在PHP的CLI,但默认情况下禁用。 要启用,编辑/etc/php5/cli/php.ini并注释掉行:

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,

如果你想在这些Apache2的启用,然后编辑该文件/etc/php5/apache2/php.ini并进行同样的更改。

这可能是最好只删除您需要使用的功能,为了尽可能多地保留的安全限制成为可能。



文章来源: Enable PCNTL in Ubuntu PHP - test fails
标签: php ubuntu pcntl