Upgrade PHP 5.3 to PHP 5.4 on Debian 6 "Squeeze" with dotdeb repository

Upgrade PHP 5.3 to PHP 5.4 on Debian 6 “Squeeze” with dotdeb repository
Apache version: 2.2
PHP version: 5.3.3
MySQL version: 5.1.73

pico /etc/apt/sources.list

deb http://dotdeb.debian.skynet.be/ squeeze all
deb-src http://dotdeb.debian.skynet.be/ squeeze all
deb http://dotdeb.debian.skynet.be/ squeeze-php54 all
deb-src http://dotdeb.debian.skynet.be/ squeeze-php54 all

import and add GPG key
wget http://www.dotdeb.org/dotdeb.gpg
cat dotdeb.gpg | apt-key add -

backup your php.ini (/etc/php5/apache2/php.ini) and my.cnf (/etc/mysql/my.cnf) files
backup also apache config directory /etc/apache2/*
then remove the old PHP5.3 from your system

apt-get remove --purge php*

apt-get update

try to install packages..
apt-get install  mysql-server-5.5 mysql-server-core-5.5 php5 php5-cgi php5-cli php5-common php5-curl php5-gd php5-imap php5-mcrypt php5-mysql php5-xsl

if you get errors..

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.

The following packages have unmet dependencies:
 mysql-server-core-5.5 : Depends: libaio1 but it is not installable
 php5-common : Depends: lsof but it is not installable

 

download and install missing files
wget http://ftp.us.debian.org/debian/pool/main/l/lsof/lsof_4.86+dfsg-1_i386.deb
dpkg -i lsof_4.86+dfsg-1_i386.deb

(find and download file for your system ( https://packages.debian.org/wheezy/lsof ))


wget http://ftp.de.debian.org/debian/pool/main/liba/libaio/libaio1_0.3.107-7_i386.deb
dpkg -i libaio1_0.3.107-7_i386.deb

(find and download file for your system ( https://packages.debian.org/squeeze/libaio1 ))

then try again
apt-get install  mysql-server-5.5 mysql-server-core-5.5 php5 php5-cgi php5-cli php5-common php5-curl php5-gd php5-imap php5-mcrypt php5-mysql php5-xsl



and done you debian 6 Squeeze updated to PHP 5.4.42.....


 

apt-get purge libapache2-mod-php5

apt-get install libapache2-mod-php5

a2enmod php5

Apache version: 2.2
PHP version: 5.4.42
MySQL version: 5.5.38

now compare your old config files with new and make necessary changes...
example php.ini settings

zend_extension=/home/ioncube/ioncube_loader_lin_5.4.so
zend_extension=/home/ZendOptimizer/ZendGuardLoader.so
max_execution_time = 120
max_input_time = 60
memory_limit = 128M
error_reporting = E_ALL | E_STRICT
display_errors = Off
track_errors = Off
post_max_size = 12M
upload_max_filesize = 120M
allow_url_include = Off
date.timezone = Europe/Amsterdam
mysql.trace_mode = Off
session.gc_maxlifetime = 7200
session.cache_expire = 180