./configure 期间缺少 OpenSSL。如何修复?我的系统是 macos

./configure 期间缺少 OpenSSL。如何修复?我的系统是 macos
checking for PCRE library ... found  
checking for PCRE JIT support ... found  
checking for OpenSSL library ... not found   
checking for OpenSSL library in /usr/local/ ... not found       
checking for OpenSSL library in /usr/pkg/ ... not found   
checking for OpenSSL library in /opt/local/ ... not found  
./configure: error: SSL modules require the OpenSSL library.You can either do not enable the modules, or install the OpenSSL libraryinto the system, or build the OpenSSL library statically from the sourcewith nginx by using --with-openssl=<path> option.ERROR: failed to run command: sh ./configure --prefix=/usr/local/openresty/nginx \...

我该如何解决这个问题?

答案1

下载并编译 OpenSSL:

cd /usr/local/src
curl --remote-name https://www.openssl.org/source/openssl-1.1.1d.tar.gz
tar -xzvf openssl-1.1.1d.tar.gz
cd openssl-1.1.1d
./config --prefix=/usr/local/openssl/
make
make install

核实:

openssl version -a

这应该可以让你开始自己编译 OpenSSL。之后,configure 应该会找到安装并使用它。

相关内容