温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

php安装多进程扩展pcntl模块

发布时间:2020-07-06 00:18:34 来源:网络 阅读:5911 作者:pygsspy 栏目:web开发

1、下载php安装包  我本地已经保留了 在目录/usr/local/src/php-5.4.7

              下载wget http://br.php.net/get/php-5.4.7.tar.gz/from/this/mirror

       解压


2、安装pcntl模块  

  cd /usr/local/src/php-5.4.7/ext/pcntl

   运行: /usr/local/php/bin/phpize


执行完之后 会输出:

Configuring for:
       PHP Api Version:         20100412
       Zend Module Api No:      20100525
       Zend Extension Api No:   220100525

执行完之后 就会生成 configure 文件。

./configure --with-php-config=/usr/local/php/bin/php-config

  ………………

  make&& make install

  …………

3、执行成功   提示 Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/

   echo extension=pcntl.so >> /usr/local/php/etc/php.ini

   重启apache


- -但是出错了 phpinfo 没有出现pcntl的扩展。

于是再修改 /usr/local/php/etc/php.ini 的extension=pcntl.so为

 extension= /usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/pcntl.so

 重启apache 。phpinfo()有了pcntl的扩展

 但是在执行php脚本的时候 /usr/local/php/bin/php ./index.php

  有警告

       PHP Warning:  PHP Startup: Unable to load dynamic library './/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/pcntl.so' - .//usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/pcntl.so: cannot open shared object file: No such file or directory in Unknown on line 0

哪里来的.//usr/local/php/lib/php/extensions/ 前面多个../

看到phpinfo()生成信息extension_dir ='./'

找到php.ini文件里extension_dir='./'去掉./

改为extension_dir=''

重启apache 一切ok!





向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI