php --ini
按下面的步骤,在ubuntu 16.04上面安装成功了 php5.6
dpkg -l | grep php| awk '{print $2}' |tr "\n" " "
apt-get install aptitude aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "` add-apt-repository ppa:ondrej/php apt-get update apt-get install php5.6 php -v vim /etc/nginx/sites-enabled/default which php ls /run/php/ ls /run/php/ -al fg apt-get install php php -v history apt-get install php5.6-fpm netstat -tnelp netstat -atunp ps aux|grep php netstat -atunp netstat -atunp|grep 9000---------------------------------------------------------------------------------------------------------------
16.04默认安装php7.0环境,但是php7目前兼容性并不是很好,如果自行安装php5需要清除php7的已安装包,否则会报错。
移除默认及已安装的PHP包
sudo dpkg -l | grep php| awk '{print $2}' |tr "\n" " "
sudo apt-get install aptitudesudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`添加 PPAsudo add-apt-repository ppa:ondrej/php安装php5.6sudo apt-get updatesudo apt-get install php5.6安装扩展sudo apt-get install php5.6-gdsudo apt-get install php5.6-mysql