swoole之环境安装(mac)

做~自己de王妃 提交于 2020-01-30 05:52:59
一、前置工作
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,这个时候愣是没找到解决方案,只能最原始的用上述方案解决。
 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!