swoole linux 安装
使用环境:
1:centos7
2:php5.6
3. swoole 2.0.10
由于服务器已经安装lnmp环境,因此直接安装了swoole。
swoole扩展下载地址:https://github.com/swoole/swoole-src/releases 尽量选择stable版本,alpha版本最好仅用于实验新特性。
cd swoole-src-swoole-1.7.6-stable/
phpize
./configure --enable-async-mysql
sudo make
sudo make install
报错信息1:
make: * No targets specified and no makefile found. Stop.
解决方法
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.6.tar.gz
tar zxvf ncurses-5.6.tar.gz
./configure -prefix=/usr/local -with-shared-without-debug
make
make install
报错信息2:
configure: error: Cannot find php-config. Please use –with-php-config=PATH
解决方案
一般出现这个错误说明你执行 ./configure 时 –with-php-config 这个参数配置路径错误导致的。
修改为:
./configure –with-php-config=/usr/local/php/bin/php-config
就可以
上面的 /usr/local/php/ 是你的 php 安装路径 ,路径完整填写是 php-config的路径
报错信息3:configure: WARNING: unrecognized options: –enable-async-mysql
解决方案:
直接删除–enable-async-mysql
原因:
从1.8.6版本开始Swoole\MySQL已内置到Swoole中,无需通过–enable-async-mysql编译参数开启。