我正在尝试用源代码构建 nginx,http_image_filter_module
但是当我添加它时出现错误。
我运行下面的命令,它可以正常工作,直到我添加参数--with-http_image_filter_module
,但这会导致它失败并出现错误:
> checking for GD library ... not found
> checking for GD library in /usr/local/ ... not found
> checking for GD library in /usr/pkg/ ... not found
> checking for GD library in /opt/local/ ... not found
> ./configure: error: the HTTP image filter module requires the GD library.
> You can either do not enable the module or install the libraries.
我尝试过使用包管理器添加 GD 库,例如
apt install libgd-dev
以及从目录中的源代码构建它/usr/local
:
cd /usr/local \
&& wget https://github.com/libgd/libgd/releases/download/gd-2.3.3/libgd-2.3.3.tar.gz \
&& tar -xvof libgd-2.3.3.tar.gz \
&& cd libgd-2.3.3 \
&& ./configure \
&& make \
&& make install
但由于某种原因,它在编译过程中没有被发现。
这是我的完整命令,后面跟着make && make install
:
./configure --prefix=${NGINX_RUN}/html --sbin-path=${NGINX_BIN} --conf-path=${NGINX_CONF}/nginx.conf \
--http-log-path=${NGINX_LOG}/access.log --error-log-path=${NGINX_LOG}/error.log \
--with-pcre --lock-path=${NGINX_LOG}/nginx.lock --pid-path=${NGINX_LOG}/nginx.pid \
--with-http_ssl_module --with-http_realip_module --with-http_sub_module \
--with-http_image_filter_module \
--modules-path=/etc/nginx/modules --with-http_v2_module \
--with-stream --with-http_addition_module --with-http_mp4_module \
--with-cc-opt="-static -static-libgcc" --with-ld-opt="-static"