Forum archive
Upgrade PHP version in LAMP to 5.3.8+
In the lamp stack PHP 5.3.3 is installed, however my application requires 5.3.8+
Another topic (/forum/general/20130221/php-version-5321) suggested installing from wheezy. Bottom line to my attempt at doing so: dependency mayham, everything broke.
There's nothing important currently installed on this container, so I don't mind fiddling and reinstalling. But how do I achieve a production stable lamp stack with 5.3.8+?
===
Attempted:
- Add wheezy main and contrib to sources.list
- apt-get install php5
- Accepted the load of dependency changes
Result:
Broke mysql-server (fails to configure every time)
PHP seemed to be at 5.4.4 from phpinfo. Running my application returned:
"preg_replace(): Compilation failed: unknown option bit(s) set at offset 0"
===
Attempted:
- After previous php5 install.
- aptitude upgrade (with wheezy still enabled)
Result:
MySQL server still broken.
PHP application functions normally on 5.4.4.
Locked myself out after a few minutes because root no longer has shell login access.
===
Attempted:
- Fresh container install.
- Add wheezy main and contrib to sources.list.
- Using aptitude install php5/wheezy and always installing package maintainer config files.
The following actions will resolve these dependencies: Remove the following packages: 1) mysql-client-5.1 2) mysql-server-5.1 3) mysql-server-core-5.1 Install the following packages: 4) libaio1 [0.3.109-3 (stable)] 5) libmysqlclient18 [5.5.31+dfsg-0+wheezy1 (stable)] 6) mysql-client-5.5 [5.5.31+dfsg-0+wheezy1 (stable)] 7) mysql-server-5.5 [5.5.31+dfsg-0+wheezy1 (stable)] 8) mysql-server-core-5.5 [5.5.31+dfsg-0+wheezy1 (stable)] Upgrade the following packages: 9) debianutils [3.4 (now, oldstable) -> 4.3.2 (stable)] 10) ifupdown [0.6.10 (now, oldstable) -> 0.7.8 (stable)] 11) initramfs-tools [0.98.8 (now, oldstable) -> 0.109.1 (stable)] 12) initscripts [2.88dsf-13.1+squeeze1 (now, oldstable) -> 2.88dsf-41 (stable)] 13) klibc-utils [1.5.20-1+squeeze1 (now, oldstable) -> 2.0.1-3.1 (stable)] 14) libblkid1 [2.17.2-9 (now, oldstable) -> 2.20.1-5.3 (stable)] 15) libc-bin [2.11.3-4 (now, oldstable) -> 2.13-38 (stable)] 16) libc6 [2.11.3-4 (now, oldstable) -> 2.13-38 (stable)] 17) libklibc [1.5.20-1+squeeze1 (now, oldstable) -> 2.0.1-3.1 (stable)] 18) libltdl7 [2.2.6b-2 (now, oldstable) -> 2.4.2-1.1 (stable)] 19) libslang2 [2.2.2-4 (now, oldstable) -> 2.2.4-15 (stable)] 20) locales [2.11.3-4 (now, oldstable) -> 2.13-38 (stable)] 21) lsb-base [3.2-23.2squeeze1 (now, oldstable) -> 4.1+Debian8+deb7u1 (stable)] 22) mysql-common [5.1.66-0+squeeze1 (now, oldstable) -> 5.5.31+dfsg-0+wheezy1 (stable)] 23) mysql-server [5.1.66-0+squeeze1 (now, oldstable) -> 5.5.31+dfsg-0+wheezy1 (stable)] 24) netbase [4.45 (now, oldstable) -> 5.0 (stable)] 25) php5-cli [5.3.3-7+squeeze16 (now, oldstable) -> 5.4.4-14+deb7u2 (stable)] 26) php5-mcrypt [5.3.3-7+squeeze16 (now, oldstable) -> 5.4.4-14+deb7u2 (stable)] 27) php5-mysql [5.3.3-7+squeeze16 (now, oldstable) -> 5.4.4-14+deb7u2 (stable)] 28) php5-xcache [1.3.0-7 (now, oldstable) -> 2.0.0-4 (stable)] 29) php5-xdebug [2.1.0-1 (now, oldstable) -> 2.2.1-2 (stable)] 30) rsyslog [4.6.4-2 (now, oldstable) -> 5.8.11-3 (stable)] 31) util-linux [2.17.2-9 (now, oldstable) -> 2.20.1-5.3 (stable)]
Fixes:
- Install will give mysql-server error. Once done, comment the default-character-set=utf8 directive in /etc/mysql/conf.d/force_utf8.cnf.
- Reinstall phpmyadmin, which will at the same time reconfigure mysql-server.
Results:
So far so good.
- MySQL runs properly, as does phpmyadmin, aside from a warning "Connection for controluser as defined in your configuration failed.".
- My PHP 5.3.8+ application runs as intended. (After enabling some apache2 mods in webmin, such as rewrite).
- The phpinfo gives: PHP Version 5.4.4-14+deb7u2, running over mod_php5 on apache2.
- After a reboot all the services remain functional.
All I'm left with is getting openpanel to work on this half squeeze half wheezy setup. But that wasn't part of this topic.
If you pin all the upgraded packages to Wheezy (and give Squeeze priority) and add Wheezy to your security list (/etc/apt/sources.list.d/security.list) you should be pretty right.
Another thing to consider is that if you plan to do backups with TKLBAM then you'll probably want to use a TKLBAM hook to adjust the appliance prior to restoration of your backup. Have a look in the docs about TKLBAM hooks.