前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Mac 安装 Swoole 出现 Enable openssl support, require openssl library 的解决办法

Mac 安装 Swoole 出现 Enable openssl support, require openssl library 的解决办法

作者头像
hedeqiang
发布2019-12-18 11:32:39
2.3K0
发布2019-12-18 11:32:39
举报
文章被收录于专栏:LaravelCodeLaravelCode

今天升级 Swoole 版本的时候,指定开启 OpenSSL 的时候报错了。以下是场景还原

安装

代码语言:javascript
复制
wget https://github.com/swoole/swoole-src/archive/v4.4.8.tar.gz
tar -xzf v4.4.8.tar.gz
cd swoole-src-4.4.8
phpize
./configure --enable-openssl --enable-sockets --enable-http2 --enable-mysqlnd

然后 make 的时候报错了

file
file
代码语言:javascript
复制
$ make

/bin/sh /Users/hedeqiang/Desktop/swoole-src-4.4.8/libtool --mode=compile g++  -I. -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -DPHP_ATOM_INC -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/include -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/main -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -I/usr/local/Cellar/php/7.3.10/include/php -I/usr/local/Cellar/php/7.3.10/include/php/main -I/usr/local/Cellar/php/7.3.10/include/php/TSRM -I/usr/local/Cellar/php/7.3.10/include/php/Zend -I/usr/local/Cellar/php/7.3.10/include/php/ext -I/usr/local/Cellar/php/7.3.10/include/php/ext/date/lib -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/include -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/thirdparty/hiredis  -DHAVE_CONFIG_H  -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11   -c /Users/hedeqiang/Desktop/swoole-src-4.4.8/php_swoole_cxx.cc -o php_swoole_cxx.lo
mkdir .libs
 g++ -I. -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -DPHP_ATOM_INC -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/include -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/main -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -I/usr/local/Cellar/php/7.3.10/include/php -I/usr/local/Cellar/php/7.3.10/include/php/main -I/usr/local/Cellar/php/7.3.10/include/php/TSRM -I/usr/local/Cellar/php/7.3.10/include/php/Zend -I/usr/local/Cellar/php/7.3.10/include/php/ext -I/usr/local/Cellar/php/7.3.10/include/php/ext/date/lib -I/Users/hedeqiang/Desktop/swoole-src-4.4.8 -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/include -I/Users/hedeqiang/Desktop/swoole-src-4.4.8/thirdparty/hiredis -DHAVE_CONFIG_H -g -O2 -Wall -Wno-unused-function -Wno-deprecated -Wno-deprecated-declarations -std=c++11 -c /Users/hedeqiang/Desktop/swoole-src-4.4.8/php_swoole_cxx.cc  -fno-common -DPIC -o .libs/php_swoole_cxx.o
In file included from /Users/hedeqiang/Desktop/swoole-src-4.4.8/php_swoole_cxx.cc:1:
In file included from ./php_swoole_cxx.h:19:
./php_swoole.h:129:2: error: "Enable openssl support, require openssl library"
#error "Enable openssl support, require openssl library"
 ^
1 error generated.
make: *** [php_swoole_cxx.lo] Error 1

开始以为 OpenSSL 没有安装,结果发现并不是

代码语言:javascript
复制
brew install openssl

Warning: openssl 1.0.2t is already installed and up-to-date
To reinstall 1.0.2t, run `brew reinstall openssl`

最后忽然想起来制定下 OpenSSL 的路径就好了

brew 安装的 OpenSSL 默认在 /usr/local/Cellar/openss/版本号

我的是 1.0.2t,因此路径为 /usr/local/Cellar/openssl/1.0.2t

代码语言:javascript
复制
./configure --with-openssl-dir=/usr/local/Cellar/openssl/1.0.2t --enable-sockets --enable-http2 --enable-mysqlnd

ok,果真如此,,之后就可以愉快的 make && make install 了。

file
file

只是记录下而已。权当笔记...

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
SSL 证书
腾讯云 SSL 证书(SSL Certificates)为您提供 SSL 证书的申请、管理、部署等服务,为您提供一站式 HTTPS 解决方案。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档