我编译自己的PHP,部分是为了更多地了解PHP如何组合在一起,部分原因是我总是发现我需要默认情况下不可用的模块,这样我可以控制它.
我的问题是,我无法在PHP中获得JPEG支持.使用CentOS 5.6.编译PHP 5.3.8时,我的配置选项如下:
'./configure' '--enable-fpm' '--enable-mbstring' '--with-mysql' '--with-mysqli' '--with-gd' '--with-curl' '--with-mcrypt' '--with-zlib' '--with-pear' '--with-gmp' '--with-xsl' '--enable-zip' '--disable-fileinfo' '--with-jpeg-dir=/usr/lib/'
./configure输出说:
checking for GD support... yes
checking for the location of libjpeg... no
checking for the location of libpng... no
checking for the location of libXpm... no
然后我们可以看到GD已经安装,但是JPEG的支持不在那里:
# php -r 'print_r(gd_info());'
Array
(
[GD Version] => bundled (2.0.34 compatible)
[FreeType Support] =>
[T1Lib Support] =>
[GIF Read Support] => 1
[GIF Create Support] => 1
[JPEG Support] =>
[PNG Support] => 1
[WBMP Support] => 1
[XPM Support] =>
[XBM Support] => 1
[JIS-mapped Japanese Font Support] =>
)
我知道PHP需要能够找到libjpeg,而且显然找不到一个它很满意的版本.我会想到/usr/lib/libjpeg.so或/usr/lib/libjpeg.so.62将是它需要的,但我提供了正确的lib目录(–with-jpeg-dir = /usr/lib /),它不会接收它们,所以我猜他们不是正确的版本.
rpm说libjpeg是安装的.我应该删除并重新安装它,并且它是依赖的包?可以解决这个问题吗?