1、安装git:yum –y install git
2、克隆swoole源码:git clone …
https://github.com/swoole/swoole-src/releases
https://pecl.php.net/package/swoole
https://gitee.com/swoole/swoole/tags
以http://git.oschina.net/swoole/swoole为例子,复制地址https://gitee.com/swoole/swoole.git
执行
git clone https://gitee.com/swoole/swoole.git
3、执行编译以下命令
cd swoole
phpize (ubuntu 没有安装phpize可执行命令:sudo apt-get install php-dev来安装phpize)
./configure
make && make install
4、配置php.ini
查找php.ini文件:
find / -name php.ini
vim /etc/php.ini
编译安装成功后:
extension=swoole.so
5、查看swoole是否安装成功:
php –m
若看到swoole,即为安装成功