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 前面增加一行 #include