1、前置工做
1.php安裝
上述操做完成後,就已經安裝好了php7.1版本,同時能夠經過pecl install xxx安裝相應的擴展
便捷命令
php -m |grep redis 查看支持的某個擴展功能
2.依賴安裝
3.安裝命令
sudo pecl download swoole
tar zxvf swoole-4.2.12.tgz
./configure --enable-openssl --enable-http2 --enable-sockets --enable-mysqlnd -with-openssl-dir=/usr/local/Cellar/openssl/1.0.2q/
make clean && make && sudo make install
爲何不直接
上述命令安裝的過程當中,依賴支持會報以下錯誤
1.fatal error: 'openssl/ssl.h' file not found
2.#error "Enable openssl support, require openssl library."
搜遍全網的解決方案,openssl安裝在/usr/local/opt/include下,經過映射到/usr/local/include下,這樣能夠解決問題1,可是會出現問題2,這個時候愣是沒找到解決方案,只能最原始的用上述方案解決。