一、前置工作
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,这个时候愣是没找到解决方案,只能最原始的用上述方案解决。
 

相关文章:

  • 2021-12-02
  • 2022-12-23
  • 2021-06-10
  • 2022-12-23
  • 2021-11-11
  • 2021-11-19
  • 2021-10-05
  • 2021-04-19
猜你喜欢
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
  • 2021-05-24
  • 2022-12-23
相关资源
相似解决方案