./configure: 错误:HTTP XSLT 模块需要 libxml2/libxslt 库

Nik*_*ani 8 nginx libxml2 libxslt macos-mojave

我最近将我的 mac-os 更新为 Mojave。我正在使用 Nginx,它在我以前的操作系统上运行,但在更新到 Mojave 后,我无法启动我的 Nginx。所以我尝试再次安装它,首先,它给了我 c 编译器错误,所以我下载了 Xcode 命令行工具,它消失了。现在它给了我找不到 libxml2/libxslt 库。我尝试使用 brew 安装它,但仍然出现相同的错误。我不确定出了什么问题。

我已经使用 brew install 下载了 libxml2 和 libxslt。

我的配置脚本。

./configure \
--prefix=/opt/nginx/$NGINX_NAME_VERSION \
--pid-path=/var/run/nginx.pid \
--conf-path=/etc/nginx/$NGINX_NAME_VERSION/conf/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--http-log-path=/var/log/nginx/access.log \
--lock-path=/var/lock/nginx.lock \
--http-client-body-temp-path=/var/tmp/nginx/body \
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-scgi-temp-path=/var/tmp/nginx/scgi \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
--with-debug \
--with-http_addition_module \
--with-http_dav_module \
--with-http_geoip_module \
--with-http_gzip_static_module \
--with-http_realip_module \
--with-http_stub_status_module \
--with-http_ssl_module \
--with-http_sub_module \
--with-http_xslt_module \
--with-mail \
--with-mail_ssl_module \
--with-cc-opt=-I/usr/local/opt/openssl/include \
--with-ld-opt=-L/usr/local/opt/openssl/lib \
--builddir=$NGINX_BUILD_PATH
Run Code Online (Sandbox Code Playgroud)

错误 :

checking for OpenSSL library ... found
checking for zlib library ... found
checking for libxslt ... not found
checking for libxslt in /usr/local/ ... not found
checking for libxslt in /usr/pkg/ ... not found
checking for libxslt in /opt/local/ ... not found
Run Code Online (Sandbox Code Playgroud)

您可以看到它能够找到 OpenSSL、zlib 但不能找到 libxslt。请有人帮我解决问题。

Foo*_*Bar 13

尝试以下

sudo apt-get install libxslt-dev
Run Code Online (Sandbox Code Playgroud)

你可能还需要

sudo apt-get install libgd-dev # for the "error: the HTTP image filter module requires the GD library." error
sudo apt-get install libgeoip-dev # for the GeoIP package
Run Code Online (Sandbox Code Playgroud)