CentOS6 编译安装 php5.3

wget   http://cn2.php.net/distributions/php-5.3.28.tar.bz2

tar -jxvf php-5.3.28.tar.bz2

./configure 
--prefix=/usr/local/php53 
--with-config-file-path=/usr/local/php53/etc 
--enable-fpm 
--with-fpm-user=nginx 
--with-fpm-group=nginx 
--enable-sysvsem 
--enable-sockets 
--enable-pcntl 
--enable-mbstring 
--enable-mysqlnd 
--enable-opcache 
--enable-shmop 
--enable-zip 
--enable-ftp 
--enable-gd-native-ttf 
--enable-wddx 
--enable-soap 
--enable-pdo 
--with-mysql=mysqlnd 
--with-mysqli=mysqlnd 
--with-pdo-mysql=mysqlnd 
--enable-zip 
--with-gd

make -j

make install 

cp php.ini-production /usr/local/php53/etc/php.ini
cp sapi/fpm/init.d.php-fpm /etc/init.d/php53-fpm
cp /usr/local/php53/etc/php-fpm.conf.default /usr/local/php53/etc/php-fpm.conf

#php-fpm 端口可在 php-fpm.conf 里修改

chmod +x /etc/init.d/php53-fpm

/etc/init.d/php53-fpm start

# php73加入环境变量
ln -s /usr/local/php53/bin/php /usr/local/bin/php53

#开机自启动
vim /etc/rc.local
/etc/init.d/php53-fpm start

# 修改不显示X-Power-By

vim /usr/local/php53/etc/php.ini

找到 expose_php

把 on 改为 off

/etc/init.d/php53-fpm restart

原文地址:https://www.cnblogs.com/dwj192/p/14349276.html