GD库问题验证码不显示分析处理

不能正常显示的验证码的phpinfo检测情况


正常显示的验证码的phpinfo检测情况


经对比有GD、Freetype、libPNG版本有小差别,而且下面的多了对XPM/XBM的支持。

多次配置gd-2.0.3335无法开启XPM、XBM支持,真让人崩溃。试下libgd

# wget https://github.com/libgd/libgd/releases/download/gd-2.1.0/libgd-2.1.0.tar.gz

# tar zxvf libgd-2.1.0.tar.gz

# cd libgd-2.1.0

# ./configure--prefix=/usr/local/gd

** Configuration summary for libgd 2.1.0:

 

  Support for Zlib:                yes

  Support for PNG library:         yes

  Support for JPEG library:        yes

  Support for VPX library:         no

  Support for TIFF library:        no

   Support for Freetype 2.x library: yes

  Support for Fontconfig library:  yes

  Support for Xpm library:         yes

  Support for pthreads:            yes

编译php

# cd php-5.3.3

./configure--prefix=/usr/local/php --with-gd  --with-jpeg-dir --with-zlib --with-png-dir --with-xpm-dir--with-freetype-dir --enable-soap --enable-magic-quotes  --with-mysql=/usr/local/mysql/--with-mysqli=/usr/local/mysql/bin/mysql_config --with-iconv-dir=/usr/local/libiconv--enable-mbstring --with-apxs2=/usr/local/apache/bin/apxs --enable-ftp--with-config-file-path=/usr/local/php/etc

configure:error: libXpm.(a|so) not found.

# ll  /usr/lib64/libXpm.so*

lrwxrwxrwx. 1root root    16 9月  18 20:41 /usr/lib64/libXpm.so ->libXpm.so.4.11.0

lrwxrwxrwx. 1root root    16 9月  18 15:18 /usr/lib64/libXpm.so.4 ->libXpm.so.4.11.0

-rwxr-xr-x. 1root root 72832 2月  22 2013/usr/lib64/libXpm.so.4.11.0

# ln -s /usr/lib64/libXpm.so.4.11.0 /usr/lib/libXpm.so

# ln -s /usr/lib64/libXpm.so.4.11.0 /usr/lib/libXpm.so.4

# ln -s/usr/lib64/libXpm.so.4.11.0 /usr/lib/libXpm.so.4.11.0

如果编译过程中遇到下列信息:

PEAR package PHP_Archive not installed: generated phar will require PHP's phar extension be enabled.

这说明没有安装PEAR,解决方案有两种:

1、./configure时附加--without-pear

2、从http://pear.php.net/go-pear下列未打包的pear安装包并执行,步骤如下:

# wget http://pear.php.net/go-pear.phar

# /usr/local/php/bin/php go-pear.phar

重启apache搞定。

 


评论
热度(1)