我是在官网下好,然后通过ftp发给服务器的
sudo yum install gcc gcc-c++ libxml2 libxml2-devel autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel zlib zlib-devel \
glibc glibc-devel glib2 glib2-devel openssl-devel bzip2-devel libcurl-devel t1lib-devel gmp-devel libc-client-devel openldap-devel unixODBC-devel \
mysql-devel expat-devel libxslt-devel libmcrypt libmcrypt-devel libedit wget
sudo tar -zxvf php-5.4.8.tar.gz -C /usr/src
./configure \
--prefix=/usr/local/php \
--with-mcrypt=/usr/local/libmcrypt \
--with-zlib --enable-mbstring \
--with-openssl \
--with-mysql \
--with-mysqli --with-mysql-sock \
--with-gd --with-jpeg-dir=/usr/lib \
--with-bz2 \
--with-pdo-mysql \
--with-gettext \
--with-curl \
--with-pdo-mysql \
--enable-sockets \
--enable-bcmath \
--enable-xml \
--enable-zip \
--enable-gd-native-ttf \
--enable-pdo \
--enable-fpm \
make
make install
cp php.ini-production /usr/local/php5/etc/php.ini
cp /usr/local/php5/etc/php-fpm.conf.default /usr/local/php5/etc/php-fpm.conf
mkdir /usr/local/php5/etc/php.d
cp sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
chmod u+x /etc/init.d/php-fpm
service php-fpm start
chkconfig php-fpm on