nginx 安装swoole

前提:

1.php >=7.2
2.已安装nginx
已经安装 pecl

执行命令

 pecl install swoole

出现错误

Warning: putenv() has been disabled for security reasons in
PEAR/Builder.php on line 367 PHP Warning: putenv() has been disabled
for security reasons in /www/server/php/72/lib/php/PEAR/Builder.php on
line 367

Warning: putenv() has been disabled for security reasons in
/www/server/php/72/lib/php/PEAR/Builder.php on line 367 running:
phpize

Warning: popen() has been disabled for security reasons in
PEAR/Builder.php on line 525 PHP Warning: popen() has been disabled
for security reasons in /www/server/php/72/lib/php/PEAR/Builder.php on
line 525

Warning: popen() has been disabled for security reasons in
/www/server/php/72/lib/php/PEAR/Builder.php on line 525 ERROR: failed
to run `phpize’

原因: PHP 默认禁用 putenv,popen

打开php.ini文件, 查找到disable_functions,在等于号(=)后面添加需禁用的函数名,去除即可 如下:

disable_functions =syslog,readlink,passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,symlink,popen,putenv,fsocket,fsockopen

继续执行:

 pecl install swoole

发现让确定
enable sockets supports? [no] : enable openssl support? [no] : enable http2 support? [no] : enable mysqlnd support? [no] :
参考: https://blog.csdn.net/taoshihan/article/details/101249348

安装上了
在这里插入图片描述

输入 php -m 查看是否有 swoole
在这里插入图片描述
完事!!
其他问题参考:
https://wiki.swoole.com/#/question/install

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值