安装php扩展(以swoole)为例

一、下载swoole到/usr/local/src目录下,操作 git clone https://gitee.com/swoole/swoole.git;

二、cd swoole,phpize(如果报错:Cannot find autoconf,执行yum -y install autoconf)

三、配置,./configure --with-php-config=/usr/local/php/bin/php-config(ps:需要提前安装gcc、gcc-c++,可以用yum安装)

四、编译及安装,make && make install

五、配置php.ini,添加extension=swoole,保存成功后可以通过php -m查看扩展中是否已经有swoole

原文地址:https://www.cnblogs.com/zhengchuzhou/p/9607278.html