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,这个时候愣是没找到解决方案,只能最原始的用上述方案解决。
相关文章
相关标签/搜索