===================================================================

1 简介

2 系统环境

3 安装步骤

3.1、安装libiconv

3.2、编译安装PHP

3.3 安装完成

===================================================================

1、简介:本篇博文主要介绍Centos 5.8下面PHP5.4的安装过程,源码编译安装时候的参数选择,目前用于我的正式环境,供读者参考


2、系统环境:

操作系统:CentOS release 5.8 x86_64

安装前提:检查Mysql及apache的安装情况,需要Mysql及apache的安装支持

PHP版本:php-5.4.23.tar.gz


3、安装步骤:

3.1、安装libiconv(加强系统对字符编码转换的支持)

wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.14.tar.gz tar zxvf libiconv-1.14.tar.gzcd libiconv-1.14 ./configure --prefix=/usr/local/libiconvmake && make install


3.2、编译安装PHP

wget http://mirrors.sohu.com/php/php-5.4.23.tar.gztar zxvf php-5.4.23.tar.gzcd php-5.4.23

编译参数参考

./configure --prefix=/usr/local/php5.4.23 \--with-apxs2=/usr/local/apache/bin/apxs \--with-mysql=/usr/local/mysql \--with-xmlrpc \--with-openssl \--with-zlib \--with-freetype-dir \--with-gd \--with-jpeg-dir \--with-png-dir \--with-iconv=/usr/local/libiconv \--enable-short-tags \--enable-sockets \--enable-soap \--enable-mbstring \--enable-static \--enable-gd-native-ttf \--with-curl \--with-xsl \--enable-ftp \--enable-zip \--with-libxml-dir

3.3 安装完成

make && make installln -s /usr/local/php5.4.23/ /usr/local/phpcp php.ini-production /usr/local/php/lib/php.ini