Beanow's picture

In the lamp stack PHP 5.3.3 is installed, however my application requires 5.3.8+

Another topic (http://www.turnkeylinux.org/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:

  1. Add wheezy main and contrib to sources.list
  2. apt-get install php5
  3. 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:

  1. After previous php5 install.
  2. 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:

  1. Fresh container install.
  2. Add wheezy main and contrib to sources.list.
  3. 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:

  1. Install will give mysql-server error. Once done, comment the default-character-set=utf8 directive in /etc/mysql/conf.d/force_utf8.cnf.
  2. 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.

Forum: 
Tags: 
Jeremy Davis's picture

Yeah that is often an issue when you start mixing versions. I had hoped that the dependdancy issues wouldn't be too great (I never actually tested my suggestion, was just throwing it out there as a theoretical solution), but it seems not...

You could try building from source (although you may still have some dependancy issues).

Also for the record if you are adding the Wheezy repo but want to keep your system (mostly) Squeeze then pinning is worth looking into... As for your MySQL issues, perhaps if you remove MySQL (with --purge switch to also remove config) and reinstall perhaps that may resolve the issue there? 

All just guesses though really...

Beanow's picture

What I'm mostly worried about now is, can a half upgraded distro be called stable and production ready?

For example, won't automatic security updates start scrambling up the dependency madness? Or does this mean I'm going to have to switch to manual updates and making disk images on every step?

Jeremy Davis's picture

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.

Beanow's picture

I've managed to get a new install running it. Updated the original post.

Next I'm trying to get openpanel working, of which the squeeze version worked out of the box before the php upgrade, but not now. Any quirks related to the upgrade method I'll try and track them here for future reference.

Add new comment