安装apache
# tar -zvxf httpd-2.2.14.tar.gz
# cd httpd-2.2.14
# ./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite
# make
# make install
安装MySQL
#yum -y install mysql-server
#yum -y install mysql-devel
安装 jpeg7
建立目录:
# mkdir -p /usr/local/jpeg7
# mkdir -p /usr/local/jpeg7/bin
# mkdir -p /usr/local/jpeg7/lib
# mkdir -p /usr/local/jpeg7/include
# mkdir -p /usr/local/jpeg7/man
# mkdir -p /usr/local/jpeg7/man1
# mkdir -p /usr/local/jpeg7/man/man1
# tar -zvxf jpegsrc.v7.tar.gz
# cd jpeg-7
# ./configure --prefix=/usr/local/jpeg7/ --enable-shared --enable-static
# make; make install
安装libpng
# tar -zvxf libpng-1.2.40.tar.gz
# cd libpng-1.2.40
# cp scripts/makefile.linux makefile
# make
# make install
安装 freetype
# tar -zvxf freetype-2.1.10.tar.gz
# cd freetype-2.1.10
# mkdir -p /usr/local/freetype
# ./configure --prefix=/usr/local/freetype
# make
# make install
安装zlib
#tar -zxvf zlib-1.2.3.tar.gz
#cd zlib.1.2.3
# ./configure
# make
# make install
安装GD库
# tar -zvxf gd-2.0.35.tar.gz
# cd gd-2.0.35
# ./configure --prefix=/usr/local/gd2 --with-jpeg=/usr/local/jpeg7/ --with-png=/usr/local/lib/ --with-zlib=/usr/local/lib/ --with-freetype=/usr/local/freetype/
# make
# make install
安装PHP
# rpm -ivh libxml2-2.6.26-2.1.2.8.i386.rpm
# rpm -ivh libxml2-devel-2.6.26-2.1.2.8.i386.rpm
# rpm -ivh pkgconfig-0.21-2.el5.i386.rpm
# yum -y install curl
# tar -zxvf php-5.2.10.tar.gz
# cd php-5.2.10
# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd=/usr/local/gd2/ --with-curl --with-jpeg-dir=/usr/local/jpeg7 --with-freetype-dir=/usr/local/freetype/
#如果上面的登录发生 mysql configure failed 错误 则先执行下面的配置,再执行上面配置就行(好像是第一次执行不能包括GD库)
# ./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql
# make
# make install
# cp php.ini-recommended /usr/local/lib