попробуйте это - избавляется от php и устанавливает его с нуля:
sudo bash
apt-get remove php5*
# now edit /etc/apt/sources.list and comment out any backports or non-canonical repositories you might have put there
apt-get clean
apt-get update
apt-get install php5-common php5-mysql libapache2-mod-php5