Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Development & Programming > Ubuntu Forums Development Archives > Lucid Lynx Testing and Discussion (CLOSED)
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Lucid Lynx Testing and Discussion (CLOSED)
Ubuntu Lucid Lynx is in development, use only for testing purposes!!!

This forum is for the discussion of Ubuntu Lucid Lynx. Lucid is in development and will be out in April 2010 and will be a long term support release. Please note: Ubuntu Developers do not usually read the forums, to report a problem found in Lucid please report the bug in Launchpad.


 
 
Thread Tools Display Modes
Old April 5th, 2010   #1
mathews.kyle
First Cup of Ubuntu
 
Join Date: May 2006
Beans: 4
Reverting PHP to 5.2 in Lucid 10.04

I recently upgraded my main development laptop to Lucid. Lucid upgraded PHP to 5.3 and as I'm mainly a PHP developer, this has caused quite a few problems. What's the easiest way to revert back to the the 5.2 series? Googling hasn't found any good solutions.
mathews.kyle is offline  
Old April 5th, 2010   #2
Mustang Matt
First Cup of Ubuntu
 
Join Date: Jul 2009
Beans: 2
Re: Reverting PHP to 5.2 in Lucid 10.04

I don't have the answer to your question, but I'm curious what problems you ran into.
Mustang Matt is offline  
Old April 5th, 2010   #3
djoxyk
5 Cups of Ubuntu
 
Join Date: Mar 2010
Location: Ukraine
Beans: 23
Xubuntu Development Release
Re: Reverting PHP to 5.2 in Lucid 10.04

I'm curious too. I have upgraded php 5.3 on lucid. It works ok.
djoxyk is offline  
Old April 5th, 2010   #4
Bachstelze
Over 9000 Cups of Ubuntu
 
Bachstelze's Avatar
 
Join Date: Nov 2005
Location: California
Beans: 10,283
Ubuntu
Send a message via AIM to Bachstelze Send a message via MSN to Bachstelze
Re: Reverting PHP to 5.2 in Lucid 10.04

Quote:
Originally Posted by mathews.kyle View Post
I recently upgraded my main development laptop to Lucid. Lucid upgraded PHP to 5.3 and as I'm mainly a PHP developer, this has caused quite a few problems. What's the easiest way to revert back to the the 5.2 series? Googling hasn't found any good solutions.
You could add the Karmic repositories to your sources.list and do some apt-policy magic to lock PHP to Karmic, or compile PHP 5.2 from source.
Bachstelze is online now  
Old April 5th, 2010   #5
obrienmd
Spilled the Beans
 
Join Date: Dec 2007
Beans: 16
Re: Reverting PHP to 5.2 in Lucid 10.04

Would be _very_ intersted in this, especially if there was a PPA / named package to do this... Drupal / Open Atrium don't play nice with PHP 5.3 yet, and many of our Drupal webapps would need non-trivial updates to do so. The latest Drupal core is rumored to work well, but none of the sites we have deployed are working well on 5.3, for whatever reason (contrib modules, etc).

Cheers!
obrienmd is offline  
Old April 5th, 2010   #6
djoxyk
5 Cups of Ubuntu
 
Join Date: Mar 2010
Location: Ukraine
Beans: 23
Xubuntu Development Release
Re: Reverting PHP to 5.2 in Lucid 10.04

if you need just downgrade version, try to remove current version and you can use synaptic to install older one, use force version under the package menu.
i do not touch Drupal, but wordpress works ok with php 5.3

another way is to download sources of 5.2 and compile it (if there's no version in reps).

Last edited by djoxyk; April 5th, 2010 at 03:41 PM.. Reason: addition
djoxyk is offline  
Old April 5th, 2010   #7
Bachstelze
Over 9000 Cups of Ubuntu
 
Bachstelze's Avatar
 
Join Date: Nov 2005
Location: California
Beans: 10,283
Ubuntu
Send a message via AIM to Bachstelze Send a message via MSN to Bachstelze
Re: Reverting PHP to 5.2 in Lucid 10.04

OK, here's how to do the Apt magic to get PHP packages from the karmic repositories:

* First remove all your existing PHP packages. You can list them with e.g.:

Code:
dpkg -l | grep php
* Then duplicate your existing sources.list replacing lucid with karmic and save it in sources.list.d:

Code:
sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list
* Create a file in /etc/apt/preferences.d like this (call it for example /etc/apt/preferences.d/php);

Code:
Package: php5
Pin: release a=karmic
Pin-Priority: 991
The big problem is that wildcards don't work, so you will need one such stanza for each PHP package you want to pull from karmic.
Bachstelze is online now  
Old April 6th, 2010   #8
obrienmd
Spilled the Beans
 
Join Date: Dec 2007
Beans: 16
Re: Reverting PHP to 5.2 in Lucid 10.04

Quote:
Originally Posted by Bachstelze View Post
OK, here's how to do the Apt magic to get PHP packages from the karmic repositories:

* First remove all your existing PHP packages. You can list them with e.g.:

Code:
dpkg -l | grep php
* Then duplicate your existing sources.list replacing lucid with karmic and save it in sources.list.d:

Code:
sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list
* Create a file in /etc/apt/preferences.d like this (call it for example /etc/apt/preferences.d/php);

Code:
Package: php5
Pin: release a=karmic
Pin-Priority: 991
The big problem is that wildcards don't work, so you will need one such stanza for each PHP package you want to pull from karmic.
Awesome! Love the idea... Hate the idea of having to remember to set this when adding any php package
obrienmd is offline  
Old April 6th, 2010   #9
obrienmd
Spilled the Beans
 
Join Date: Dec 2007
Beans: 16
Re: Reverting PHP to 5.2 in Lucid 10.04

Quote:
Originally Posted by Bachstelze View Post
OK, here's how to do the Apt magic to get PHP packages from the karmic repositories:

* First remove all your existing PHP packages. You can list them with e.g.:

Code:
dpkg -l | grep php
* Then duplicate your existing sources.list replacing lucid with karmic and save it in sources.list.d:

Code:
sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list
* Create a file in /etc/apt/preferences.d like this (call it for example /etc/apt/preferences.d/php);

Code:
Package: php5
Pin: release a=karmic
Pin-Priority: 991
The big problem is that wildcards don't work, so you will need one such stanza for each PHP package you want to pull from karmic.
Actually, this seems to make apt-get / aptitude install ALL NEW packages from the karmic repositories...
obrienmd is offline  
Old April 6th, 2010   #10
Reiger
Fresh Brewed Ubuntu
 
Join Date: Jul 2008
Beans: 1,491
Re: Reverting PHP to 5.2 in Lucid 10.04

No it won't. It will now have *both* the Lucid and the Karmic repositories enabled side by side; and because the Lucid versions of all software is from a repository with a higher major version number than their Karmic counterparts this will make APT use Lucid repositories (it prefers latest software by default), unless specified otherwise.

That is where the preferences file comes in; it basically tells APT to prefer the karmic PHP packages to the Lucid ones.

Where this gets problematic is if PHP or associated packages depend on things like binutils that have broken their ABI or API over an upgrade. If that happens you will have Karmic PHP & related packages built for the old calling conventions confronted with the new ones and failing in interesting ways... Similarly if packages have been dropped or renamed or something like that you will have trouble to get APT to do conflict resolution and installation properly.
Reiger is offline  
 

Bookmarks

Tags
10.04, lucid, php 5.2, php 5.3

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:35 PM.


vBulletin ©2000 - 2012, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry