PHP中的GD库安装(最新原创)
如果是用RPM包装的PHP+Mysql+Apache,GD库默认就装好了。如果想要编译安装这些,GD库是要自己动手安装上去的。我编译安装(源代码)了Apache+PHP,现在要用到GD库,所以又要装GD库了在网上找了好多资料,都不太详细或过时了。看了一些文档,总算弄好了,现在总结出来。在Red Hat Linux 9.0+Apache+PHP下通过。Powered by aspbiz(at)163.com原文或更新请见我的博客:http://blog.chinaunix.net/index.php?blogId=724一、下载gd-2.0.33.tar.gz [url=http://www.boutell.com/gd/]http://www.boutell.com/gd/[/url]jpegsrc.v6b.tar.gz [url=http://www.ijg.org/]http://www.ijg.org/[/url]libpng-1.2.7.tar.tar [url=http://sourceforge.net/projects/libpng/]http://sourceforge.net/projects/libpng/[/url]zlib-1.2.2.tar.gz [url=http://sourceforge.net/projects/zlib/]http://sourceforge.net/projects/zlib/[/url]freetype-2.1.9.tar.gz [url=http://sourceforge.net/projects/freetype/]http://sourceforge.net/projects/freetype/[/url]php-4.3.9.tar.gz [url=http://www.php.net/]http://www.php.net[/url]二、说明最新的GD库包括了对GIF的支持,所以不要打GIF补丁http://sourceforge.net/ 好多源代码包可以在上面找到安装步骤:先安装zlib,freetype,libpng,jpeg,再装GD,再装PHP三、安装1.装zlib tar zxvf zlib-1.2.2.tar.gz cd zlib-1.2.2 ./configure make make install2.安装libpng tar zxvf libpng-1.2.7.tar.tar cd libpng-1.2.7 cd scripts/ mv makefile.linux ../makefile cd .. make make install 注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个3.安装freetype tar zxvf freetype-2.1.9.tar.gz cd freetype-2.1.9 ./configure make make install4.安装Jpeg tar zxvf jpegsrc.v6b.tar.gz cd jpeg-6b/ ./configure --enable-shared make make test make install注意,这里configure一定要带--enable-shared参数,不然,不会生成共享库5.安装GD tar zxvf gd-2.0.33.tar.gz cd gd-2.0.33 ./configure --with-png --with-freetype --with-jpeg make install6.安装PHP tar zxvf php-4.3.9.tar.gz cd php-4.3.9 ./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql --with-gd --with-zlib --with-png --with-jpeg --with-freetype --enable-sockets make make install7.配置Apache支持PHP8.测试phpinfo();?>;Ok.....