参考网址:https://wiki.swoole.com/wiki/page/6.html
- git clone https://gitee.com/swoole/swoole.git
- cd swoole.git //在根目录下运行
- phpize //生成编译检测脚本
- ./configure --with-php-config=/usr/local/php/bin/php-config //编译配置检测,注:/usr/local/php/bin/php-config要根据自己的路径来,可以进行全文搜索来找出位置
如果出现如下错误:
Cannot find php-config. Please use --with-php-config=PATH 那就说明您的参数配置路径错误。 - make //进行编译
- sudo make install //安装
- 更改php.ini文件,在末尾添加extension=swoole.so 我的环境是lnmp1.5一键安装包,php.ini文件在/usr/local/php/etc文件夹下