centos7 安装swoole

安装依赖 

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

posted @ 2019-06-03 16:07  陈俊武  阅读(1427)  评论(0编辑  收藏  举报