在Ubuntu 12.04上PHP从5.3升级到php 5.6

I am following this tutorial on upgrading php from ver 5.3 to 5.6 :http://phpave.com/upgrade-php-53-to-php-56-on-ubuntu-1204-lts/

sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update && sudo apt-get dist-upgrade

The problem is that apache is also upgraded. Is it possible to update only php without upgrading apache server ?

sudo LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install php5.6

Try to use apt-get upgrade instead of apt-get dist-upgrade

Use this command:

sudo apt-get install php5

Safest way to do it is to do an entire OS update to ubuntu 14LTS. From there you can update using the following PPA:

sudo apt-get update && sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install php5