php --ini
按下面的步骤,在ubuntu 16.04上面安装成功了 php5.6
dpkg -l | grep php| awk '{print $2}' |tr "
" " "
apt-get install aptitude
aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "
" " "`
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
---------------------------------------------------------------------------------------------------------------
Ubuntu 16.04默认安装php7.0环境,但是php7目前兼容性并不是很好,如果自行安装php5需要清除php7的已安装包,否则会报错。
移除默认及已安装的PHP包
sudo dpkg -l | grep php| awk '{print $2}' |tr "
" " "
sudo apt-get install aptitude
sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "
" " "`
添加 PPA
sudo add-apt-repository ppa:ondrej/php
安装php5.6
sudo apt-get update
sudo apt-get install php5.6
安装扩展
sudo apt-get install php5.6-gd
sudo apt-get install php5.6-mysql