Project

General

Profile

DebianDowngradePHP » History » Version 3

Andreas Kohlbecker, 05/02/2012 06:20 PM

1 1 Andreas Kohlbecker
2
## Downgrade php5.3 to php5.2 on Debian squeeze
3
 
4
5 2 Andreas Kohlbecker
An alternative to downgrading is to install both versions in parallel: http://bernhardhaeussner.de/blog/89_Howto:_PHP5.3_parallel_zu_PHP5_installieren
6
7
8 1 Andreas Kohlbecker
1. find all installed packages
9
10
11
~~~
12
dpkg -l | grep -i php
13
~~~
14
15
2. remove them
16
17
18
~~~
19
apt-get remove <package>
20
~~~
21
22
3. add the lenny sources to /etc/apt/source.list
23
24
25
4. pin the version of php and of related packages by creating the following file
26
27
28
/etc/apt/preferences.d/php5
29
30
31
~~~
32
Package: libapache2-mod-php5 libapache2-mod-php5filter
33
Pin: version 5.2*
34
Pin-Priority: 1001
35
36
Package: php5-suhosin
37
Pin: version 0.9.2*
38
Pin-Priority: 1001
39
40
Package: php5 php5-cgi php5-cli php5-common php5-curl php5-dbg php5-dev php5-enchant php5-gd php5-gmp
41
Pin: version 5.2*
42
Pin-Priority: 1001
43
44
Package: php5-imagick php5-imap php5-interbase php5-intl php5-ldap php5-mcrypt php5-mhash php5-mysql php5-odbc php5-pgsql
45
Pin: version 5.2*
46
Pin-Priority: 1001
47
48
Package: php5-pspell php5-recode php5-snmp php5-sqlite php5-sybase php5-tidy php5-xmlrpc php5-xsl php-pear
49
Pin: version 5.2*
50
Pin-Priority: 1001
51
52
Package: php-benchmark
53
Pin: version 1.2.7*
54
Pin-Priority: 1001
55
56
Package: php-compat
57
Pin: version 1.5.0*
58
Pin-Priority: 1001
59
60
Package: php-http
61
Pin: version 1.4.0*
62
Pin-Priority: 1001
63
64
Package: php-http-request
65
Pin: version 1.4.2*
66
Pin-Priority: 1001
67
68
Package: php-net-socket
69
Pin: version 1.0.8*
70
Pin-Priority: 1001
71
72
Package: php-net-url
73
Pin: version 1.0.15*
74
Pin-Priority: 1001
75
76
Package: php5-xdebug
77
Pin: version 2.0.3*
78
Pin-Priority: 1001
79
80
~~~
81
82
Simulate the installation
83
84
85
~~~
86
 apt-get install -s php5 libapache2-mod-php5 php5-cli php5-common php5-curl php5-gd php5-mcrypt php5-mysql php5-suhosin
87
~~~
88
89
if everything is OK run the real installation by skipping the `-s` option.
90
91
Otherwise check the broken packages with the following command and pin the needed version in `apt-cache policy php5-suhosin ` 
92
93
94
~~~
95
apt-cache policy <broken backage name> 
96
~~~
97
98
99
5. restart apache
100
101
~~~
102
/etc/init.d/apache restart
103
~~~
104
see also: http://debianforum.de/forum/viewtopic.php?f=8&t=122611
105 3 Andreas Kohlbecker
106
107
108
----
109
110
111
112
113
###  Apt preference files for other distributions and versions
114
115
116
* Ubuntu 11.10 attachment:"php5"