> CentOS > CentOS教程 >

CentOS 6.5安装GD(LAMP)

1.上传源码包:
libxml2-2.6.32.tar.gz
zlib-1.2.5.1.tar.gz
libpng-1.2.44.tar.gz
jpegsrc.v6b.tar.gz
freetype-2.3.11.tar.gz
gd-2.0.35.tar.gz

2.安装libxml2:
tar zxvf libxml2-2.6.32.tar.gz -C /usr/src/
cd /usr/src/libxml2-2.6.32
./configure --prefix=/usr/local/libxml2
make
make install

3.安装zlib:
tar zxvf zlib-1.2.5.1.tar.gz -C /usr/src/
cd /usr/src/zlib-1.2.5.1
./configure --prefix=/usr/local/zlib
make
make install

4.安装libpng:
tar zxvf libpng-1.2.44.tar.gz -C /usr/src/
cd /usr/src/libpng-1.2.44
./configure --prefix=/usr/local/libpng
make
make intall

5.安装jpeg:
mkdir -p /usr/local/jpeg
mkdir -p /usr/local/jpeg/bin
mkdir -p /usr/local/jpeg/lib
mkdir -p /usr/local/jpeg/include
mkdir -p /usr/local/jpeg/man
mkdir -p /usr/local/jpeg/man1
mkdir -p /usr/local/jpeg/man/man1
tar zxvf jpegsrc.v6b.tar.gz -C /usr/src/
cd /usr/src/jpeg-6b
(配置编译之前一定要安装好libtool)
rpm -qa | grep libtool
rm -rvf config.sub
rm -rvf config.guess
cp /usr/share/libtool/config/config.sub .
cp /usr/share/libtool/config/config.guess .
./configure --prefix=/usr/local/jpeg --enable-shared --enable-static
make
make install
ln -s /usr/lib64/libjpeg.so /usr/lib/libjpeg.so
ln -s /usr/lib64/libpng.so /usr/lib/libpng.so

6.安装freetype:
tar zxvf freetype-2.3.11.tar.gz -C /usr/src/
cd /usr/src/freetype-2.3.11
./configure --prefix=/usr/local/freetype
make
make install

7.安装gd库:
tar zxvf gd-2.0.35.tar.gz -C /usr/src/
cd /usr/src/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
make
make install

(责任编辑:IT)