升级的过程先要添加一个新的repo然后抹去老的php5.5 , 然后安装5.6,最后加上5.6 的mysql驱动.注意它同时会装上php7!
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get purge php5-common
sudo apt-get install libapache2-mod-php5.6
sudo a2dismod php5 # disable php5 mod in apache
sudo a2enmod php5.6 # enabel php5.6 mod in apache
sudo apt-get install php5.6-mysql # 可能需要重新安装一些扩展 比如mysql
sudo service apache2 restart
参考 http://askubuntu.com/questions/776164/ubuntu-14-04-problems-upgrading-php-to-5-6