越简单越好!

macos10.11下安装swoole

发表于 2015-10-21 15:19 | 1538次阅读 0次点赞   PHP

1. 从 https://github.com/swoole/swoole-src/releases 下载一个最新的稳定包。

2. 下载后解压目录

3. 把解压的 swoole-1.7.20-stable 移动到 /usr/include/php/ext
#mv swoole-1.7.20-stable/ /usr/include/php/ext/swoole

4. 开始make 
#cd /usr/include/php/ext/swoole
#phpize
#sudo ./configure
#sudo make && make install

5. 在php.ini 增加swoole
#sudo vi /etc/php.ini
查找到 Dynamic Extensions 添加的位置
增加 extension=swoole.so

6. 查看是否成功
#php -m | grep swoole
如果有就说明安装成功了。

7. 如果碰到以下错误提示
/usr/include/php/ext/pcre/php_pcre.h:29:10: fatal error: 'pcre.h' file not found #include "pcre.h"

8. 就用brew安装下pcre, 如果没有brew就百度一下
#brew install pcre



返回顶部 ^