linux下为php添加GD库的安装步骤
本节内容:
为linux系统下的php添加GD库扩展支持。
一、所需的库文件(下载地址在本文末尾)
jpegsrc.v6b.tar.gz
libpng-1.2.8.tar.tar
zlib-1.2.3.tar.gz (md5:debc62758716a169df9f62e6ab2bc634)
freetype-2.1.10.tar.gz
二、安装
1,安装zlib
cd zlib-1.2.3
./configure --prefix=/usr/local/zlib
make
make install
2,安装libpng
cd libpng-1.2.8
mv ./scripts/makefile.linux ./makefile
make
make install
注意,这里的makefile不是用./configure生成,而是直接从scripts/里拷一个。
3,安装freetype
cd freetype-2.1.10
./configure --prefix=/usr/local/freetype
make
make install
4,安装Jpeg
cd jpeg-6b/
./configure --enable-shared
make
make test
make install
注意,configure一定要带--enable-shared参数,否则不会生成共享库。
5,安装GD库
cd gd-2.0.33
./configure --with-png --with-jpeg --with-freetype=/usr/local/freetype
make
make install
6,重新编译PHP
cd php-4.3.9
./configure (以前的参数) --with-gd --enable-gd-native-ttf --with-zlib-dir=/usr/local/zlib --with-png --with-jpeg --with-freetype-dir=/usr/local/freetype
make
make install
以上用到的库文件的下载地址:
1、gd库下载:http://www.libgd.org/releases/
2、zlib库下载: http://www.zlib.net/
3、libpng库下载:http://www.libpng.org/pub/png/libpng.html
4、freetype下载:http://ftp.twaren.net/Unix/NonGNU/freetype/
5、jpeg7下载:http://download.chinaunix.net/download.php?id=28882&ResourceID=5095
您可能感兴趣的文章:
php gd库的基础知识
linux下为php添加GD库的安装步骤
linux下php gd 库的安装步骤
Linux下开启PHP GD库支持
PHP图片裁剪函数(图像不变形)
Linux下PHP GD库的安装与开启方法
linux下安装 php GD支持库的方法
PHP添加GD库支持的步骤详解
php5安装GD库步骤分享
linux下yum为php安装gd库