最新消息:

如何解决 “您的主机不支持 FreeType 库 “——php重编译安装GD

VPS ZmmFly 4549浏览 0评论

遇到这个问题主要是因为我配置破Dz的防灌水时出现的…..

由于博主一直追求完美…看到那又红又碍眼的”您的主机不支持 FreeType 库”时就觉得应该消灭它…

其实吧…很简单…只要在php编译时加上相关的参数就可以了(也就是在重现编译PHP时加上相关参数)(非编译的可以用yum或者是apt-get安装相应的包就行了)

这里我只说说是怎么解决的…如果按照我下面的方法不能解决的,大家可以在评论中提出来

下载必要资源

首先下载下列的源码包

libipeg  –  http://www.ijg.org/files/jpegsrc.v9.tar.gz

libpng  –  http://t.cn/zTgAx90

zlib  –  http://t.cn/zTVy3yu

freetype  –  http://t.cn/zTVyddP

gd  –  http://fossies.org/linux/www/gd-2.0.35.tar.gz

以上均可以wget

php  –  版本自选,不提供地址

 安装

#安装jpeg库
tar zxvf jpegsrc.v9.tar.gz

cd jpeg-9

./configure --prefix=/usr/local/jpeg

make

make install

#安装png库

tar zxvf libpng-1.6.1.tar.gz

cd libpng-1.6.1

./configure --prefix=/usr/local/libpng

make

make install

#安装zlib

tar zxvf zlib-1.2.7.tar.gz

cd zlib-1.2.7

./configure --prefix=/usr/local/zlib

make

make install

#安装FreeType

tar zxvf freetype-2.4.11.tar.gz

./configure --prefix=/usr/local/freetype

make

make install

#安装GD

tar zxvf gd-2.0.35.tar.gz

cd gd-2.0.35

./configure --prefix=/usr/local/gd --with-zlib=/usr/local/zlib/ --with-png=/usr/local/libpng/ --with-jpeg=/usr/local/jpeg/ --with-freetype=/usr/local/freetype/

#重新编译PHP并安装

#版本大家自定,下面的编译参数仅在php-5.3.23上通过...其余版本请大家自行参考

./configure --prefix=/usr/local/php/ --with-config-file-path=/usr/local/php/etc/ --with-apxs2=/usr/local/apache/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-mysql-sock=/tmp/mysql.sock --with-gd=/usr/local/gd/ --with-iconv --with-jpeg-dir=/usr/local/jpeg/ --with-zlib=/usr/local/zlib/ --enable-xml --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curlwrappers --enable-mbstring=all --enable-ftp --enable-gd-native-ttf --with-openssl --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --with-gettext --enable-session --enable-imap --enable-calendar --enable-eaccelerator=shared --enable-wddx --with-mcrypt=/usr/local/libmcrypt/ --with-freetype-dir=/usr/local/freetype/ --without-pear ; make ; make install

好了,装好后重启下你的Web服务器,再看看吧~~~Dz后面是不是木有FreeType的提示了?PHP是不是不再报图像处理错误了?

转载请注明:神奇海域 » 如何解决 “您的主机不支持 FreeType 库 “——php重编译安装GD

发表我的评论
取消评论

Protected by WP Anti Spam

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址