Install php53 to php52 in parallel » History » Version 22
Andreas Kohlbecker, 05/02/2012 06:08 PM
1 | 1 | Andreas Kohlbecker | |
---|---|---|---|
2 | |||
3 | ## How to install php5.3 to php5.2 in parallel |
||
4 | |||
5 | |||
6 | 18 | Andreas Kohlbecker | _This instructions are specific to Debian Linux and derivatives like Ubuntu from version 12.04 on. For install php5.3 to php5.2 in parallel in older distributions please refer to [[Install_php53_to_php52_in_parallel_ubuntu-1110|Install php5.3 to php5.2 in parallel in ubuntu-11.10]]._ |
7 | |||
8 | |||
9 | 20 | Andreas Kohlbecker | **In the following you will find a brief description on how to compile and install php 5.2 from source.** |
10 | 1 | Andreas Kohlbecker | |
11 | 2 | Andreas Kohlbecker | |
12 | |||
13 | 1 | Andreas Kohlbecker | see also: |
14 | |||
15 | * http://bernhardhaeussner.de/blog/89_Howto:_PHP5.3_parallel_zu_PHP5_installieren |
||
16 | |||
17 | * http://artur.ejsmont.org/blog/content/compiling-and-building-php-53-on-ubuntu |
||
18 | 2 | Andreas Kohlbecker | |
19 | |||
20 | |||
21 | |||
22 | |||
23 | 3 | Andreas Kohlbecker | ### Install additional packages |
24 | 2 | Andreas Kohlbecker | |
25 | |||
26 | ~~~ |
||
27 | 13 | Andreas Kohlbecker | apt-get install bison re2c libmysqlclient-dev libbz2-dev bzip2 libxslt1.1 libxslt1-dev libxml2 libxml2-dev libjpeg62-dev libpng12-dev libxpm-dev |
28 | 2 | Andreas Kohlbecker | ~~~ |
29 | 4 | Andreas Kohlbecker | |
30 | 6 | Andreas Kohlbecker | _You may need more package if you are not having apache2, mysql, gcc and linux sources._ |
31 | 5 | Andreas Kohlbecker | |
32 | 6 | Andreas Kohlbecker | |
33 | |||
34 | 21 | Andreas Kohlbecker | ### Check symlinks in /usr/lib (Ubuntu only, not needed for Debian?) |
35 | 5 | Andreas Kohlbecker | |
36 | |||
37 | Check if the below symlinks exist in @/usr/lib@, if nor create them!: |
||
38 | |||
39 | |||
40 | 1 | Andreas Kohlbecker | ~~~ |
41 | 21 | Andreas Kohlbecker | # cd /usr/lib |
42 | # ln -s x86_64-linux-gnu/libjpeg.a libjpeg.a |
||
43 | # ln -s x86_64-linux-gnu/libjpeg.so libjpeg.so |
||
44 | # ln -s x86_64-linux-gnu/libpng.a libpng.a |
||
45 | # ln -s x86_64-linux-gnu/libpng.so libpng.so |
||
46 | # ln -s x86_64-linux-gnu/libXpm.so libXpm.so |
||
47 | # ln -s x86_64-linux-gnu/libgd.a libgd.a |
||
48 | # ln -s /usr/include/gd.h gd.h |
||
49 | # ln -s /usr/lib/x86_64-linux-gnu/libmysqlclient.so /usr/lib/ |
||
50 | 5 | Andreas Kohlbecker | ~~~ |
51 | 1 | Andreas Kohlbecker | |
52 | 21 | Andreas Kohlbecker | see also https://github.com/vladgh/VladGh.com-LEMP/blob/master/install_files/php.sh |
53 | 1 | Andreas Kohlbecker | |
54 | |||
55 | |||
56 | 8 | Andreas Kohlbecker | |
57 | 1 | Andreas Kohlbecker | |
58 | 21 | Andreas Kohlbecker | ### Download and extract php 5.2 source |
59 | |||
60 | |||
61 | 8 | Andreas Kohlbecker | 1. download http://php.net/downloads.php |
62 | |||
63 | 1. extract |
||
64 | |||
65 | 6 | Andreas Kohlbecker | 1. cd into the extracted folder |
66 | |||
67 | |||
68 | |||
69 | ### Run the configure command |
||
70 | |||
71 | |||
72 | |||
73 | _This configuration is based on based on [pkg-php/php.git/debian/rules":http://anonscm.debian.org/gitweb/?p=pkg-php/php.git;a=blob_plain;f=debian/rules;hb=HEAD._ The php5.2 rules are found "here](http://anonscm.debian.org/gitweb/?p=pkg-php/php.git;a=blob_plain;f=debian/rules;hb=41ffb985b80d560777d6c9f9264d129cc6d386ee) |
||
74 | 1 | Andreas Kohlbecker | |
75 | 6 | Andreas Kohlbecker | |
76 | Run the configure command below inside the extracted php source folder. |
||
77 | 1 | Andreas Kohlbecker | |
78 | 6 | Andreas Kohlbecker | |
79 | 21 | Andreas Kohlbecker | `dpkg-architecture -qDEB_HOST_GNU_TYPE` |
80 | 6 | Andreas Kohlbecker | |
81 | 21 | Andreas Kohlbecker | |
82 | 6 | Andreas Kohlbecker | ./configure is *reporting errors*: |
83 | 10 | Andreas Kohlbecker | |
84 | 12 | Andreas Kohlbecker | 1. I you are getting an error like `configure: error: xxxx not found. Please check your XXXX installation.` Check if you have installed the xxx package and also the according development package. |
85 | |||
86 | 1. You can debug your the configuration by searching for the line of code in `./configure` wich is producing the error message and add the following code snipped before the lines found: |
||
87 | |||
88 | |||
89 | 10 | Andreas Kohlbecker | ~~~ |
90 | ###DEBUG |
||
91 | set -x |
||
92 | ~~~ |
||
93 | |||
94 | Execute the configure command again an see the detailed output. |
||
95 | |||
96 | 14 | Andreas Kohlbecker | |
97 | |||
98 | ### Build and install |
||
99 | |||
100 | |||
101 | ~~~ |
||
102 | make |
||
103 | # optional, dauert, findet aber Fehler: |
||
104 | make test |
||
105 | # bringt die Dateien an ihren Platz: |
||
106 | 21 | Andreas Kohlbecker | sudo make install | tee php52-install.log |
107 | 14 | Andreas Kohlbecker | ~~~ |
108 | 15 | Andreas Kohlbecker | |
109 | |||
110 | ### Configure Apache |
||
111 | |||
112 | |||
113 | This was the tricky part! |
||
114 | |||
115 | Now please follow the instruction on: http://bernhardhaeussner.de/blog/89_Howto:_PHP5.3_parallel_zu_PHP5_installieren |
||
116 | |||
117 | |||
118 | 10 | Andreas Kohlbecker |