Project

General

Profile

Downgrade php5.3 to php5.2 on Debian squeeze

An alternative to downgrading is to install both versions in parallel: http://bernhardhaeussner.de/blog/89_Howto:_PHP5.3_parallel_zu_PHP5_installieren

  1. find all installed packages
dpkg -l | grep -i php
  1. remove them
apt-get remove <package>
  1. add the lenny sources to /etc/apt/source.list

  2. pin the version of php and of related packages by creating the following file

/etc/apt/preferences.d/php5

Package: libapache2-mod-php5 libapache2-mod-php5filter
Pin: version 5.2*
Pin-Priority: 1001

Package: php5-suhosin
Pin: version 0.9.2*
Pin-Priority: 1001

Package: php5 php5-cgi php5-cli php5-common php5-curl php5-dbg php5-dev php5-enchant php5-gd php5-gmp
Pin: version 5.2*
Pin-Priority: 1001

Package: php5-imagick php5-imap php5-interbase php5-intl php5-ldap php5-mcrypt php5-mhash php5-mysql php5-odbc php5-pgsql
Pin: version 5.2*
Pin-Priority: 1001

Package: php5-pspell php5-recode php5-snmp php5-sqlite php5-sybase php5-tidy php5-xmlrpc php5-xsl php-pear
Pin: version 5.2*
Pin-Priority: 1001

Package: php-benchmark
Pin: version 1.2.7*
Pin-Priority: 1001

Package: php-compat
Pin: version 1.5.0*
Pin-Priority: 1001

Package: php-http
Pin: version 1.4.0*
Pin-Priority: 1001

Package: php-http-request
Pin: version 1.4.2*
Pin-Priority: 1001

Package: php-net-socket
Pin: version 1.0.8*
Pin-Priority: 1001

Package: php-net-url
Pin: version 1.0.15*
Pin-Priority: 1001

Package: php5-xdebug
Pin: version 2.0.3*
Pin-Priority: 1001

Simulate the installation

 apt-get install -s php5 libapache2-mod-php5 php5-cli php5-common php5-curl php5-gd php5-mcrypt php5-mysql php5-suhosin

if everything is OK run the real installation by skipping the -s option.

Otherwise check the broken packages with the following command and pin the needed version in apt-cache policy php5-suhosin

apt-cache policy <broken backage name> 
  1. restart apache
/etc/init.d/apache restart

see also: http://debianforum.de/forum/viewtopic.php?f=8&t=122611


Apt preference files for other distributions and versions

  • Ubuntu 11.10 attachment:"php5"
Add picture from clipboard (Maximum size: 40 MB)