说明:
操作系统:CentOS
php安装目录:/usr/local/php
php.ini配置文件路径:/usr/local/php/etc/php.ini
1、安装swoole
cd /usr/local/src
wget https://github.com/swoole/swoole-src/archive/v1.9.1-stable.tar.gz
tar zxvf v1.9.1-stable.tar.gz
cd swoole-src-1.9.1-stable
/usr/local/php/bin/phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
2、配置php支持swoole
vi /usr/local/php/etc/php.ini #编辑配置文件,在最后一行添加以下内容
添加
extension=swoole.so
:wq! #保存退出
3、重启php-fpm
service php-fpm restart
在phpinfo页面可以看到关于swoole的选项,说明安装成功。
至此,Linux下php安装swoole扩展教程完成。

» 转载请注明来源:系统运维 » Linux下php安装swoole扩展


