编译php+mysql+apache+gd

php,apache,mysql,gd的安装  
准备redhat7.1,安装为server system。
一,安装gd库
# tar zxvf gd-1.8.4gif.tar.gz
# cd gd-1.8.4
# vi Makefile
CFLAGS=-0 DHAVE_LIBXPM -DHAVE_LIBPNG -DHAVE_LIBJPEG
LIBS=-lgd -lpng -lz -ljpeg -lm
INCLUDEDIRS=-I. -i/usr/include -I/usr/include/X11 -I/usr/X11R6/include/X11 -
I/usr/local/include
# make
# make install

二,安装mysql
# tar zxvf mysql-3.23.40.tar.gz
# cd mysql-3.23.40
# ./configure --prefix=/usr/mysql
# make
# make install
# scripts/mysql_install_db
# cd /usr/mysql/bin
# ./safe_mysqld &
# ./mysqladmin -u root password "new-password"
# cp /usr/mysql/share/mysql/mysql.server /etc/rc.d/init.d/mysql
# echo "/etc/rc.d/init.d/mysql start">>/etc/rc.d/rc.local

三,安装apache与php
# tar zxvf apache_1.3.20.tar.gz
# cd apache_1.3.20
# ./configure --prefix=/usr/apache
# cd ..
# tar zxvf php-4.0.6.tar.gz
# cd php-4.0.6
# ./configure --with-mysql=/usr/mysql --with-apache=../apache-1.3.20 --enable-
track-vars --with-xml --with-ldap --with-gd=/usr/local --with-zlib=/usr --with-
jpeg-dir=/usr --with-png-dir=/usr
# make
# make install
# cp php.ini-dist /usr/local/lib/php.ini
# cd ..
# cd apache_1.3.20
# ./configure --prefix=/usr/apache --activate-module=src/modules/php4/libphp4.a --
enable-module=php4
# make
# make install
# vi /usr/apache/conf/httpd.conf
去掉#注释
AddType application/x-httpd-php .php .php3 php4
AddType application/x-httpd-php-source .phps
AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl .php3 .php .phps .php4
DirectoryIndex index.htm index.html index.php index.php3

四,安装Zend Optimizer
# tar zxvf ZendOptimizer-1[1].1.0-PHP_4.0.5-Linux_glibc21-i386.tar.gz
# cd ZendOptimizer-1.1-PHP_4.0.5-Linux_glibc21-i386
# mkdir /usr/local/lib/php/zend
# cp ZendOptimizer.so /usr/local/lib/php/zend
# vi /usr/local/lib/php.ini
最后一行加入
zend_optimizer.optimization_level=15
zend_extension="/usr/local/lib/php/zend/ZendOptimizer.so"