CentOS7, PHP 7.1.11
Swoole 编译安装说明 三、 Swoole 安装
由于 Swoole 已经收录到 PHP 官方扩展库,可以使用 pecl 命令安装 Swoole 扩展
#php version > 7 $ wget http://pear.php.net/go-pear.phar $ php go-pear.phar #php version < 7 yum install php-pear # 否则会报错PHP Parse error: syntax error, unexpected 'new' (T_NEW) in /usr/share/pear/PEAR/Frontend.php on //line 91
3.2 安装 Swoole
$ sudo pecl install swoole
# 报错如下
/# Warning: Invalid argument supplied for foreach() in Command.php on line 249
$ vi `which pecl`
# 找到最后一行 exec $PHP -C -n -q $INCARG -d date.timezone=UTC -d output_buffering=1 -d variables_order=EGPCS -d safe_mode=0 -d register_argc_argv="On" $INCDIR/peclcmd.php "[email protected]"
# 去掉 -n 标示
$ sudo pecl install swoole
# 报错如下
# running: phpize
# Can't find PHP headers in /usr/include/php
$ yum install php71w-devel
$ sudo pecl install swoole
错误:php70w-common conflicts with php-common-5.3.3-49.el6.x86_64 You could try using --skip-broken to