“出于安全原因”pcntl 无法在 Ubuntu 上运行

2024-03-11

我已经在 Ubuntu 32 位 12.10 上运行的 PHP 5.4.6 上安装了 pcntl,使用this http://www.crimulus.com/2010/07/30/howto-enable-pcntl-in-ubuntu-php-installations/文章。

一点也不顺利,因为编译后,运行时make test我收到以下错误。每次我尝试分叉子进程时都会收到警告,其中显示:

警告:出于安全原因,第 8 行 /var/www/mydev/dev/mailServiceTest.php 中的 pcntl_fork() 已被禁用

我在网上搜索了解决方案,但不幸的是我没有在其他地方找到任何提及此问题的信息。

    Build complete.
Don't forget to run 'make test'.
PHP Warning:  Module 'pcntl' already loaded in Unknown on line 0
PHP Warning:  Module 'pcntl' already loaded in Unknown on line 0

=====================================================================
PHP         : /usr/bin/php 
Warning: Module 'pcntl' already loaded in Unknown on line 0

PHP_SAPI    : cli
PHP_VERSION : 5.4.6-1ubuntu1.2
ZEND_VERSION: 2.4.0
PHP_OS      : Linux - Linux oleg-Lenovo-G580 3.5.0-26-generic #42-Ubuntu SMP Fri Mar 8 23:20:06 UTC 2013 i686
INI actual  : /php/php-5.4.6/ext/pcntl/tmp-php.ini
More .INIs  :  
CWD         : /php/php-5.4.6/ext/pcntl
Extra dirs  : 
VALGRIND    : Not used
=====================================================================
TIME START 2013-04-28 12:11:03
=====================================================================
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 Test pcntl_get_last_error() [tests/pcntl_get_last_error.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-04-28 12:11:07

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

Number of tests :   15                15
Tests skipped   :    0 (  0.0%) --------
Tests warned    :    0 (  0.0%) (  0.0%)
Tests failed    :   15 (100.0%) (100.0%)
Expected fail   :    0 (  0.0%) (  0.0%)
Tests passed    :    0 (  0.0%) (  0.0%)
---------------------------------------------------------------------
Time taken      :    4 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]
Test pcntl_get_last_error() [tests/pcntl_get_last_error.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]
=====================================================================

You may have found a problem in PHP.
This report can be automatically sent to the PHP QA team at
http://qa.php.net/reports and http://news.php.net/php.qa.reports
This gives us a better understanding of PHP's behavior.
If you don't want to send the report immediately you can choose
option "s" to save it.  You can then email it to [email protected] /cdn-cgi/l/email-protection later.
Do you want to send this report now? [Yns]: y

Please enter your email address.
(Your address will be mangled so that it will not go out on any
mailinglist in plain text): [email protected] /cdn-cgi/l/email-protection 

Posting to http://qa.php.net/buildtest-process.php

Thank you for helping to make PHP better.
oleg@oleg-Lenovo-G580:/php/php-5.4.6/ext/pcntl$ version

当输入以下命令时,看起来 PHP 确实已经安装了,尽管在我安装此扩展之前 PHP 解释器根本无法识别该功能:

oleg@oleg-Lenovo-G580:/php/php-5.4.6/ext/pcntl$ php -m | grep pcntl
PHP Warning:  Module 'pcntl' already loaded in Unknown on line 0
pcntl

如何配置此功能才能正常工作?


须藤gedit

sudo gedit /etc/php5/cli/php.ini

or \ and

sudo gedit /etc/php5/apache2/php.ini find:

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

将此注释掉:

;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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

“出于安全原因”pcntl 无法在 Ubuntu 上运行 的相关文章

随机推荐

  • JSLint:在定义错误之前使用函数

    我使用 JSLint 来验证我的大部分外部 Javascript 文件 但我得到的最大数量的错误来自于定义之前使用的函数 这真的是我应该担心的问题吗 看来 Firefox IE7 和 Chrome 并不关心 功能与流行的一样init 我经常
  • 时间延迟 Tkinter

    我想在 PyDev Eclipse python 2 75 中制作一个图形窗口 我做了一些事情 但我想做一个 入口 眨眼 它测试用户输入 如果它是一个整数 它应该闪烁绿色一秒钟 然后变成白色 但如果它是一串其他东西 它应该闪烁红色 然后变成
  • 如何制作分割文本输入占位符?

    我想要做的事情也许最好用图像来解释 我将在下面添加 但本质上它是文本inputHTML 字段一半是预先存在的值 另一半是可替换的 我尝试添加两个value and a placeholder场 然后通过将它们分开padding left在
  • python SyntaxError 与 dict(1=...), 但 {1:...} 有效

    Python 似乎在接受字典类型的键方面不一致 或者 换句话说 它允许以一种定义字典的方式使用某些类型的键 但不允许以其他方式使用 gt gt gt d 1 one 2 2 gt gt gt d 1 one gt gt gt e dict
  • UIHostingController 是否必须位于视图控制器层次结构中?

    我想在我的基于 UIKit 的 UI 中嵌入一些 SwiftUI 不幸的是 Apple 不提供UIHostingView only UIHostingController 我可以或多或少地忽略该控制器并只使用它的视图 还是我真的需要将它添加
  • Clojure 中 definterface 和 defprotocol 的区别

    除了缺少文档之外 还有什么区别definterface and defprotocol在 Clojure 中 根据Clojure 的乐趣 使用的优点definterface over defprotocol受到限制 完全是因为前者允许原始类
  • 在 Libgdx 中使用屏幕时重用代码

    根据我在阅读其他人关于如何制作不同屏幕的代码时的理解 您执行一个主处理程序类 然后为每个屏幕创建一个新类 让我困惑的是 每当你创建一个新屏幕时 你都必须重新定义将要渲染的所有内容 例如 SpriteBatch 精灵 字体等 有没有办法在所有
  • Scala:包导入冲突

    我正在导入一个隐式 scala concurrent ExecutionContext Implicits global 在此之前 我import global Analytics xyzMethod 其中 global 是我的包中的一个目
  • 如何将大型 xml 文件的一部分反序列化为 C# 类?

    我已经阅读了一些关于如何反序列化 xml 的帖子和文章 但仍然没有弄清楚应该如何编写代码来满足我的需求 所以 我为另一个关于反序列化 xml 的问题道歉 我有一个大 50 MB 的 xml 文件 需要反序列化 我使用 xsd exe 获取文
  • 如何将 Blender 3D 动画导入 iPhone OpenGL ES?

    我正在尝试使用 OpenGL ES 在 iPhone 上制作动画 我能够在 Blender 3D 软件中制作动画 我可以将 Blender 导出为 obj 文件到 OpenGL 并且它可以在 iPhone 上运行 但我无法将我的动画作品从
  • 辅助功能:仅使用带有 href="#" 的 javascript 链接

    我有一个 React SPA 其中有一些链接可以导航到其他页面或同一页面上的其他位置 这些导航要么以编程方式决定 要么依赖 javascript 转到同一页面上的另一个位置 我可能不知道链接href当显示链接时 所以我将其渲染为href a
  • 我们需要用 自己实现双缓冲吗?

    我开始使用 Canvas 带有 GWT 我们需要自己实现双缓冲吗 想知道浏览器是否已经以某种方式为我们实现了这一点 Thanks 您绝对不需要自己实现双缓冲 这样做会浪费时间和性能 对我们来说幸运的是 每个画布实现都会在幕后为您实现它 这是
  • 如何检查 Firebase 数据库值是否存在?

    我正在将实时数据库与 Google 的 Firebase 结合使用 并且尝试检查子项是否存在 我的数据库结构如下 root users james jake rooms room1 room 1 properties room2 room
  • 在 Python 中从图像中提取连接的对象

    我有一个graysacle png 图像 我想从图像中提取所有连接的组件 有些组件具有相同的强度 但我想为每个对象分配一个唯一的标签 这是我的图片 我尝试了这段代码 img imread images soccer cif str i zf
  • @EnableMongoAuditing 和 @CreatedDate 审核在 Spring Boot 2.4.3 中不起作用

    我正在关注这个例子https github com hantsy spring reactive sample blob master boot exception handler src main java com example dem
  • jquery地址怎么用呢?

    我试图了解如何使用 jQuery 地址插件来处理 ajax 的深度链接 但文档非常差 我找不到任何好的教程来解释正在发生的事情 我认为一个好的文档和好的例子对于每个插件都很重要 有人可以解释或提供一些有用的解释链接吗 address cha
  • codeigniter $this->upload->do_upload() = false

    我正在尝试上传文件 我选择一个文件然后提交它 但 this gt upload gt do upload 的结果始终为 false 这是我的表格
  • subprocess.Popen execve() arg 3 包含非字符串值

    我正在尝试通过 shell 运行另一个脚本 该脚本使用一组修改后的环境变量 def cgi call script environ pSCRIPT subprocess Popen script stdout subprocess PIPE
  • 替换失败是否是依赖非类型模板参数的错误?

    假设我有这些模板别名 enum class enabler template
  • “出于安全原因”pcntl 无法在 Ubuntu 上运行

    我已经在 Ubuntu 32 位 12 10 上运行的 PHP 5 4 6 上安装了 pcntl 使用this http www crimulus com 2010 07 30 howto enable pcntl in ubuntu ph