安裝依賴
yum -y install autoconf
下載源碼安裝包
wget https://github.com/swoole/swoole-src/archive/v2.0.6.tar.gz
tar -zvxf v2.0.6.tar.gz
編譯安裝
cd swoole-src-2.0.6
使用安裝 php 時生成的 phpize 來生成 configure 配置文件(可以用 whereis phpize
查看路徑,其中 php-config 和 phpize 所在的目錄是相同的)
./configure --with-php-config=/data1/server/php/bin/php-config
make && make install
開啟swoole擴展
vi /data1/server/php/php.ini 添加 extension=swoole.so
重啟服務(php-fpm & nginx)
php-fpm restart
查看安裝
php -m |grep swoole
swoole 官網:https://www.swoole.com/
參考 https://www.jianshu.com/p/5ab90b7bb250