Linux 原始碼包配置PHP時出錯:configure: error: GD build test failed. Please check the config.log
Ps: 正確解答此問題者,追加200分。不夠的還可以增加。謝謝啊。無語啊。。。本來已經搭建好的源碼環境,結果由於PHP版本太高,無法用Zend ZendOptimizer。我就把PHP5.6.4給卸載了,然後想裝一個5.2.6的:結果在配置時始終出錯啊:配置語句:# ./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-jpeg-dir=/usr/local/jpeg6/ --with-png-dir=/usr/local/libpng/ --with-freetype-dir=/usr/local/freetype/ --with-gd=/usr/local/gd2 --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets出錯資訊為:configure: error: GD build test failed. Please check the config.log for details.# cat config.log發現錯誤如下(由於字數限制,下面省略了一些行):/usr/local/gd2/lib/libgd.so: undefined reference to `jpeg_destroy_decompress@LIBJPEG_6.2'/usr/local/gd2/lib/libgd.so: undefined reference to `jpeg_CreateCompress@LIBJPEG_6.2'/usr/local/gd2/lib/libgd.so: undefined reference to `jpeg_read_header@LIBJPEG_6.2'/usr/local/gd2/lib/libgd.so: undefined reference to `jpeg_read_scanlines@LIBJPEG_6.2'/usr/local/gd2/lib/libgd.so: undefined reference to `jpeg_start_compress@LIBJPEG_6.2'/usr/local/gd2/lib/libgd.so: undefined reference to `jpeg_destroy_compress@LIBJPEG_6.2'…………/usr/local/gd2/lib/libgd.so: undefined reference to `jpeg_std_error@LIBJPEG_6.2'/usr/local/gd2/lib/libgd.so: undefined reference to `jpeg_finish_compress@LIBJPEG_6.2'這樣的錯誤在config.log這個檔案中出現了很多次。自己已經重裝了jpeg6,重裝了GD,都不行。。請問如何解決,非常感謝。
此問題已自己解決
./configure --prefix=/usr/local/php/ --with-apxs2=/usr/local/apache2/bin/apxs --with-config-file-path=/usr/local/php/lib/ --with-config-file-scan-dir=/usr/local/etc/ --with-zlib --with-curl --enable-bcmath --with-jpeg-dir --with-png-dir --with-xpm-dir --with-freetype-dir --with-gd --with-mhash --enable-mbstring --with-mcrypt --with-libxml-dir --with-iconv-dir --with-pcre-dir --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd
看一下是不是有庫不全。
安裝 php 5.5.25 多加了參數 --with-gd=/usr/local/gd /usr/local/gd = 2.0.35 升級 2.44 之後 報錯 如下解決:
[root@s php-5.5.25]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql/ --with-libxml-dir=/usr/local/libxml2/ --with-png-dir=/usr/local/libpng/ --with-jpeg-dir=/usr/local/jpeg/ --with-freetype-dir=/usr/local/freetype/ --with-gd --with-mcrypt=/usr/local/libmcrypt/ --with-mysqli=/usr/local/mysql/bin/mysql_config --enable-soap --enable-mbstring=all --enable-sockets
解決: --with-gd=/usr/local/gd2
換成系統gd試試
--with-gd 升級php gd庫2.0.35 為 GD-2.44後解決辦法。