根据Php版本选择合适的版本
https://pecl.php.net/package/swoole
下载
wget -c https://pecl.php.net/get/swoole-5.1.1.tgz
解压
tar -zxvf swoole-5.1.1.tgz
进入目录
cd swoole-5.1.1
phpize
配置编译安装
#//查看php-config 路径 find / -name php-config
./configure --with-php-config=/usr/local/php/bin/php-config
make && make install
将扩展extension=swoole.so添加到 /usr/local/php/etc/php.ini 中。
找到你的php.ini所在位置,
vim /usr/local/php/etc/php.ini
添加extension=swoole.so (centos8 extension=“swoole.so” )
重启
lnmp restart
或者
service php-fpm restart