swoole之環境安裝(mac)


一、前置工作
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,這個時候愣是沒找到解決方案,只能最原始的用上述方案解決。
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM