我的php安装目录:/www/server/php/74
php.ini配置文件路径:/www/server/php/74/etc/php.ini
1、安装swoole
cd /usr/local/src
wget https://github.com/swoole/swoole-src/archive/v2.1.3.tar.gz
tar zxvf v2.1.3.tar.gz
cd swoole-src-2.1.2
/www/server/php/74/bin/phpize
./configure --with-php-config=/www/server/php/74/bin/php-config
make
make install
2、配置php支持swoole
vim /www/server/php/74/etc/php.ini #编辑配置文件,在最后一行添加以下内容
添加
extension=swoole.so
:wq! #保存退出
3、重启php-fpm
service php-fpm restart