系统环境是Red Hat Enterprise Linux AS release 4 (Nahant Update 3)
首先是准备工作
1.建立初始目录:
mkdir /usr/local/modules
2.安装libxml
# tar -zxf libxml2-2.6.16.tar.gz
# cd libxml2-2.6.16
# ./configure (xml默认安装就可以,不要指定路径了,因为安装时php可能找不到它,PHP5只支持libxml2-2.5.10以上版本)
# make
# make install
3.安装zlib
tar xzvf zlib-1.2.2.tar.gz
cd zlib-1.2.2
#不要用--prefix自定义安装目录,影响gd的安装
./configure
make
make install
4.安装freetype
tar xzvf freetype-2.1.5.tar.gz
cd freetype-2.1.5
./configure --prefix=/usr/local/modules/freetype
make
make install
5.安装libpng
tar xzvf libpng-1.2.5.tar.gz
cd libpng-1.2.5
cp scripts/makefile.linux makefile
make
make install
6.安装jpeg
建立jpeg目录
mkdir /usr/local/modules/jpeg6
mkdir /usr/local/modules/jpeg6/bin
mkdir /usr/local/modules/jpeg6/lib
mkdir /usr/local/modules/jpeg6/include
mkdir /usr/local/modules/jpeg6/man
mkdir /usr/local/modules/jpeg6/man/man1
开始安装
tar xzvf jpegsrc.v6b.tar.gz
./configure --prefix=/usr/local/modules/jpeg6 --enable-shared --enable-static
make
make install
7.安装GD
tar xzvf gd-2.0.33.tar.gz
./configure --prefix=/usr/local/modules/gd \
>--with-jpeg=/usr/local/modules/jpeg6 \
>--with-png --with-zlib \
>--with-freetype=/usr/local/modules/freetype
make
make install