我目前正在RedHat7服务器上从源代码中安装带有GD库的PHP,我正面临一些问题。
我使用以下命令配置PHP:
./configure --with-apxs2=/server/lib/httpd/bin/apxs --with-pdo-mysql --with-config-file-path=/server/php-7.3.9/conf --with-libxml-dir=/server/lib/libxml2 --with-curl=/server/lib/curl --with-gd --enable-mbstring --with-jpeg-dir=/server/lib/libjpeg --with-png-dir=/server/lib/libpng –with-webp-dir=/server/lib/webp它可以工作,但是当我执行make命令时,我得到了这个错误:
/bin/ld: /server/lib/webp/lib/libwebp.a(picture_enc.o): relocation R_X86_64_PC32 against symbol `WebPMemoryWrite' can not be used when making a shared object; recompile with -fPIC
/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [libphp7.la] Error 1我也试图在没有webp的情况下编译和安装它(在PHP文档:php doc中并不需要它),但是我得到了这个错误:
ext/gd/libgd/.libs/gd_webp.o: In function `gdImageCreateFromWebpCtx':
/server/php-7.3.9/ext/gd/libgd/gd_webp.c:68: undefined reference to `WebPGetInfo'
/sever/php-7.3.9/ext/gd/libgd/gd_webp.c:79: undefined reference to `WebPDecodeARGB'
ext/gd/libgd/.libs/gd_webp.o: In function `gdImageWebpCtx':
/server/php-7.3.9/ext/gd/libgd/gd_webp.c:153: undefined reference to `WebPEncodeRGBA'
collect2: error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1因此,这似乎是必需的。你能帮我解决这个问题吗?谢谢
发布于 2019-10-03 23:22:16
我通过替换安装的webp包解决了我的问题。首先,我使用预编译的linux包,并将其替换为本机源代码,然后通过编译、make和make install解决了这个问题。
感谢所有人
https://stackoverflow.com/questions/58204127
复制相似问题