1、环境安装包:httpd-2.2.31php-5.3.27mysql-5.5.49
2、环境所需的依赖包yum -y install gcc make gcc-c++ cmake perl-devel zlib-devel pcre pcre-devel curl libcurl libcurl-devel apr apr-devel libxml2-devel openssl openssl-devel bzip2 bzip2-devel libpng libpng-devel libjpeg libjpeg-devel freetype freetype-devel ncurses-devel apr-util libvpx-devel
yum -y install libmcrypt-devel
注:需先安装epel-release之后才能安装 libmcrypt-devel
3、安装httpd-2.2.31
wget http://www-eu.apache.org/dist/httpd/httpd-2.2.31.tar.gz
tar xf httpd-2.2.31.tar.gz
cd httpd-2.2.31
./configure --prefix=/application/apache2.2.31 --enable-deflate --enable-expires --enable-headers --enable-modeules=most --enable-so --enable-proxy --enable-rewrite --with-mpm=worker --with-included-apr
make
make install
ln -s /application/apache2.2.31/ /application/apache
vim httpd.conf
AddType application/x-httpd-php .php
AddType application/x-httpd-php .html
AddType application/x-httpd-php .php .phtml .php3 .php4 .php5
AddType application/x-httpd-php-source .phps
4、安装PHP-5.3.27http://cn2.php.net/get/php-5.3.27.tar.gz/from/this/mirror./configure --prefix=/application/php5.3.27 --with-apxs2=/application/apache/bin/apxs --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbstring --enable-mbregex --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-short-tags --enable-zend-multibyte --enable-static --with-xsl --enable-ftp
make
make install
ln -s /application/php5.3.27/ /application/php
cp php.ini-production /application/php5.3.27/lib/php.ini
5、安装PHP-5.5.38./configure --prefix=/application/php5.5.38 --with-apxs2=/application/apache/bin/apxs --enable-mysqlnd --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbstring --enable-mbregex --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-short-tags --enable-zend-multibyte --enable-static --with-xsl --enable-ftp
make
make install