在使用函数pcntl_fork()时报错  Fatal error: Uncaught Error: Call to undefined function pcntl_fork()....,原因是没有安装pcntl扩展包,有两种解决方式,一种是在编译php的时候加上./configure        --enable-pcntl,另一种是进入php源码的安装目录,运行phpize。

这里我选择第二种方式,进入压缩包目录

# pwd
/usr/local/src/php-7.1./ext/pcntl
# phpize
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:
# ./configure --with-php-config=/usr/local/php/bin/php-config
# make && make install
---------------------------------------------------------------------- Build complete.
Don't forget to run 'make test'. Installing shared extensions: /usr/local/php/lib/php/extensions/no-debug-non-zts-/ //复制路径
# vim /usr/local/php/etc/php.ini  

extension= /usr/local/php/lib/php/extensions/no-debug-non-zts-/pcntl.so  //加入此行代码

修改保存后重启php,查看phpinfo

OK~

PHP Fatal error: Uncaught Error: Call to undefined function pcntl_fork().. 开启php pcntl扩展实现多进程的更多相关文章

  1. PHP-问题处理Fatal error: Uncaught Error: Call to undefined function mb_strlen()

    1.问题 今天重新安装了ubuntu,PHP,MySQL,Apache,到测试CMS项目时发生一个错误: Fatal error: Uncaught Error: Call to undefined ...

  2. PHP-问题处理Fatal error: Uncaught Error: Call to undefined function simplexml_load_file()

    1.问题 今天重新安装了ubuntu,PHP,MySQL,Apache,到测试CMS项目时发生一个错误: Fatal error: Uncaught Error: Call to undefined ...

  3. SQL注入平台(sqli-labs)搭建提示Fatal error: Uncaught Error:

    笔者搭建该平台时用的是phpstudy,估计wampserver和xmapp也适用 搭建过程中出现错误 在浏览器进入sqli-labs时有以下提示 Fatal error: Uncaught Erro ...

  4. Fatal error: Uncaught Error: Call to a member function bind_param() on boolean

    1.2019年10月22日 PHP写mysqli 预编译查询的时候报错. Fatal error: Uncaught Error: Call to a member function bind_par ...

  5. Fatal error: Uncaught Error: Call to undefined function curl_init()

    系统:win7 对于此错误首先检查php_curl扩展是否开启 , extension=curl  #注意去掉前面的分号 然后检查php\ext下是否有php_curl.dll 文件(默认都有) ph ...

  6. Fatal error: Uncaught Error: Call to undefined function mysqli_connect()

    sudo apt-get install php7.2-mysql  //版本号肯能不一样 sudo dpkg-reconfigure  php7.2-mysql sudo /etc/init.d/m ...

  7. phpcms切换到php7.2后无法修改文章提示Uncaught Error: [] operator not supported for strings

    前段时间将客户的phpcms站点升级到php7.2,相对比较顺利,但是今天他反应文章无法修改了,提示Uncaught Error: [] operator not supported for stri ...

  8. swoole错误“Uncaught Error: Class 'swoole_server' not found”的解决办法

    如果你在执行swoole对应文件时,报下面的错误, PHP Fatal error: Uncaught Error: Class 'swoole_server' not found in /mnt/w ...

  9. 在ubuntu16.10 PHP测试连接MySQL中出现Call to undefined function: mysql_connect()

    1.问题: 测试php7.0 链接mysql数据库的时候发生错误: Fatal error: Uncaught Error: Call to undefined function mysqli_con ...

随机推荐

  1. js中字符串支持正则表达式的方法

    设一个字符串var myName = "fangming";则支持正则表达式的方法有:split(分割),replace(替换),search(查找),match(元素参数的数组) ...

  2. ubuntu安装TexturePicker

    TexturePacker网页:https://www.codeandweb.com/texturepackerTexturePacker下载页面:https://www.codeandweb.com ...

  3. JDBC--Result 获取返回集合

    package jdbc.chap05; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql. ...

  4. 调试寄存器 原理与使用:DR0-DR7

    调试寄存器 原理与使用:DR0-DR7 下面介绍的知识性信息来自intel IA-32手册(可以在intel的开发手册或者官方网站查到),提示和补充来自学习调试器实现时的总结. 希望能给你带去有用的信 ...

  5. poj_2195 最小费用最大流

    题目大意 一个nxm的地图,地图上的横纵交错成nxm个交叉点,其中有k个交叉点为房间,k个交叉点为k个小人的初始位置.小人可以在地图上沿着水平或垂直方向行走,每走一步的代价为1.求这k个小人分别到达k ...

  6. 【linux】Centos下登陆mysql报错#1045 - Access denied for user 'root'@'localhost' (using password: NO)

    创建mysql  远程链接 grant all privileges on *.* to 'test'@"%" identified by "test666 with g ...

  7. poj3744 Scout YYF I[概率dp+矩阵优化]

    Scout YYF I Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8598   Accepted: 2521 Descr ...

  8. 3149: [Ctsc2013]复原

    3149: [Ctsc2013]复原 Time Limit: 10 Sec  Memory Limit: 128 MBSec  Special JudgeSubmit: 95  Solved: 44[ ...

  9. Java初学者笔记四:按行读写文件和输入处理

    一.我们来看python的很简单: 1.读文件: with open("/path/file","r") as fr: for line in fr.readl ...

  10. java设计模式----外观模式(门面模式)

    外观模式主要应用场景在于为复杂的子系统提供一个简单的接口,提高子系统的独立性. 创建DrawerOne类: package facade; public class DrawerOne { publi ...