使用root权限安装
1.下载swoole扩展
# git clone https://github.com/swoole/swoole-src.git
# cd swoole-src
2.编译
# phpize
# ./configure --with-php-config=/usr/local/php/bin/php-config (如果不知道php-config在哪 使用 find / -name php-config)
3.安装
# make && make install
4.在php配置文件中添加swoole
# find / -name php.ini 查找PHP配置文件
# vi r/etc/php.ini
配置文件中添加 extension=swoole.so
5.检测swoole是否安装成功
# php -m