Grasp.Today

php5.3.*编译出现make: *** [ext/gd/libgd/gd_compat.lo] Error 1 解决方法

 升级系统,把php5.2.9升级到5.3.6,按照以前的编译参数,configure能正常通过,但是在make的时候提示:

In file included from /root/php-5.3.6/ext/gd/libgd/gd_compat.c:8:
/usr/local/jpeg/include/jpeglib.h:938: error: expected declaration specifiers or ‘...’ before ‘FILE’
/usr/local/jpeg/include/jpeglib.h:939: error: expected declaration specifiers or ‘...’ before ‘FILE’
make: *** [ext/gd/libgd/gd_compat.lo] Error 1
百度谷歌了好久,网上给的方案是修改 php-5.3.6/ext/gd/libgd/gd_compat.c 的代码。把文件里面的png.h和jpeglib.h路径改成自己环境下的绝对路径,比如:/usr/local/libpng/include/png.h  和 /usr/local/jpeg/include/jpeglib.h 重新configure, make 结果还是不行,提示同样错误。后来看到国外的一个论坛上找到了解决方法:
修改php-5.3.6/ext/gd/libgd/gd_compat.c 把png.h 改成绝对路径(这个在编译gd库的时候应该就碰到了,同样的路径即可)
并在# include <jpeglib.h> 前面增加一行 #include <stdio.h>   
 
php5.3.*编译出现make: *** [ext/gd/libgd/gd_compat.lo] Error 1 解决方法 - 李坤山 - 李坤山VS断悬
 
然后make clean
重新configure  、make 、make install 就可以了。
posted @ 2013-08-22 13:41  gaohj  阅读(1025)  评论(1编辑  收藏  举报