PHP+GD安装补充

| |
[不指定 2006/03/02 23:37 | by ipaddr ]
PHP+GD安装补充

之前,我曾写过PHP+GD库的安装,当时,font-config,freetype,libjpeg,libpng等库都是使用RPM包方式安装上去的,此方式安装,一般不会出问题。
但在使用真彩色的图片时,imagettftext函数就会出现错误,表现为颜色失真,字体和形状失真。
之所以引起这样的错误,主要是RedHat自带的freetype库有问题。解决的办法是:

1.先把freetype删除

rpm -e freetype --nodeps
rpm -e freetype-devel --nodeps

2.再源代码安装最新的Freetype
Freetype官方网站:http://www.freetype.org
上官方网站下载最新的freetype2.1.10

tar zxvf freetype-2.1.10.tgz
cd freetype-2.1.10
./configure
make
make install

3.安装好Freetype后,再安装PHP,此时需要注意,一定要加上以下几个参数:
--with-ttf
--with-freetype
--with-freetype-dir=/usr/local

完整的参数列表,可参考:
./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd --with-zlib --with-png --with-ttf --with-jpeg --with-freetype --with-freetype-dir=/usr/local --with-xpm --with-iconv --enable-exif --enable-sockets --enable-ftp --enable-mbstring --enable-gd-native-ttf
Net | 评论(0) | 引用(0) | 阅读(4652)