swoole linux 安裝

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編譯參數開啓。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章