swoole之環境安裝(mac)

1、前置工做
1.php安裝
brew install php71
brew link --force php@7.1
上述操做完成後,就已經安裝好了php7.1版本,同時能夠經過pecl install xxx安裝相應的擴展
便捷命令
php -v 查看版本
php -m |grep redis 查看支持的某個擴展功能
php --ini 查看配置文件路徑
2.依賴安裝
brew install openssl
brew install nghttp2
3.安裝命令
sudo pecl download swoole
tar zxvf swoole-4.2.12.tgz
cd swoole-4.2.12
phpize
./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
爲何不直接
sudo pecl install swoole
上述命令安裝的過程當中,依賴支持會報以下錯誤
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,這個時候愣是沒找到解決方案,只能最原始的用上述方案解決。
相關文章
相關標籤/搜索