首先,测试环境centos6 64位及centos7,easypanel2.6.26,kangle3.5.14 php7.3.0
如果是centos7请忽略gcc安装,首先升级gcc库到4.8,
curl -Lks http://yum.osyum.com/linux/gcc/hop5.repo > /etc/yum.repos.d/hop5.repo
yum install gcc gcc-g++ -y
可以忽略接下来安装nghttp
wget http://yum.osyum.com/linux/nghttp/nghttp2-1.35.0.tar.gz
tar -zxvf nghttp2-1.35.0.tar.gz
cd nghttp2-1.35.0
./configure
make
make install
wget --no-check-certificate https://codeload.github.com/swoole/swoole-src/zip/master -O swoole-src-master.zip
unzip swoole-src-master.zip
cd swoole-src-master
/vhs/kangle/ext/php73/bin/phpize
./configure --with-php-config=/vhs/kangle/ext/php73/bin/php-config
make
make install
出现这样证明成功一半了,接着让php支持swoole,接下来我们来做php73支持swool的扩展
mv /root/php-7.3.0/php.ini-development/vhs/kangle/ext/php73/etc/php.d/php.ini
编辑vi /vhs/kangle/ext/php73/etc/php.d/php.ini
在尾部加上
extension = "/vhs/kangle/ext/php73/lib/php/extensions/no-debug-non-zts-20180731/swoole.so"
保存退出,如果你还有编译其它模块,也可以加上
查看是否支持swoole模块
/vhs/kangle/ext/php73/bin/php -m
列表中有swoole证明完全成功
注意重启后,kangle的php7.3可能会使用/vhs/kangle/ext/php73/etc/php.d/php.ini作为新的php.ini,所以你还需要对php.ini作出安全处理
在disable_functions=后加入
eval,passthru,exec,system,chroot,scandir,chgrp,chown,shell_exec,proc_open,proc_get_status,ini_alter,ini_restore,dl,pfsockopen,openlog,syslog,readlink,symlink,popepassthru,stream_socket_server,disk_total_space,disk_free_space,error_log,putenv,popen,ini_set,chmod,assert,pcntl_exec,phpfunc;
保存退出