Posted by Anonymous on April 9, 2010 at 2:07pm
There is a problem with Lucid Lynx and Drupal, Lucid Lynx comes with php5.3 and Drupal code doesnt run smoothly on that version. So what we want to do is to revert back to 5.2 on, how do we do that? Its simple:
sudo apt-get purge php5*
sudo apt-get clean
sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list
Package: php5
Pin: release a=karmic
Pin-Priority: 991
I had to create one of these files for php5-common and php5-mysql to so you might have to do that.
sudo apt-get update
Comments
Php 5.3
I thought I read on Drupal.org that php 5.3 is supported by Drupal 6.14 and higher.
I also read elsewhere online the following: "It is best to use php 5.3 on Ubuntu if the modules imagecache and imagecache actions are to be used. Both rely on the GD lib. Php's built-in GD lib was declared a security risk by Ubuntu so it is not included. Php 5.3 fixes the problem" That confused me but it is a verbatim quote.
As I am setting up a linux box at linode, I am currently trying to decide which flavor of linux to use and what installation quirks I'll need to deal with. I am a system admin noob who has never worked in linux but I am teachable and am learning. Your words have importance to me but I admit that I am now confused by the mixed instructions I am reading.
There is an issue on the php
There is an issue on the php 5.3 problem over here: http://drupal.org/node/360605
Here is a quick explanation of every step:
sudo apt-get purge php5*
apt-get is a command for using "aptitude" which is the application for package management in Debian(Ubuntu is based on Debian) based OS's. You use it for uninstalling, installing, upgrading(and more) applications. It fetches the packages from something that is called a "repository", basicly a server that hosts these packages. The command above simply removes the installed php5 applications.
sudo apt-get clean
This command cleans aptitudes cache of downloaded packages. Forcing it to redownload on reinstallation.
sed s/lucid/karmic/g /etc/apt/sources.list | sudo tee /etc/apt/sources.list.d/karmic.list
The /etc/apt/sources.list contains all the repositories where aptitude looks for software. What we do here is to add the repository for ubuntu 9.10(karmic koala) so we can instruct aptitude to install php5 from there instead. This repository contains pre 5.3 versions of php so this would fix our problem. The file with this karmic.list file is placed in sources.list.d/ which is a directory for other repository list files.
This line simple streams the data from /etc/apt/sources.list, replacing every occurance of "lucid" with "karmic" and uses the | command to forward that datastream to the tee command. More information on these commands and the | can be found here:
http://unixhelp.ed.ac.uk/CGI/man-cgi?sed
http://unixhelp.ed.ac.uk/CGI/man-cgi?tee
http://www.linux.com/archive/feed/45679 <- About Pipes like | (and filters)
This is a directory where you place files with settings for particular packages. In this case forcing the use of a the karmic repository we added:
Package: php5
Pin: release a=karmic
Pin-Priority: 991
sudo apt-get update
This command updates the information concerning from the repositories.
using apt-get install php5 php5common etc we then install all the packages again.
I hope that helped, tried to be thurough. :)
I will never cease to be
I will never cease to be amazed by the Drupal community. I have read the rants about some who volunteer support but I, for one, have never had that experience. Instead, I find people like the OP, Nenne, who take time out of their busy days to give very detailed help to a noob. Thank you so very much Nenne!
I am working on installs of apache, php, mysql on the linode server this weekend. Not sure if I will go with a bundled lamp or install from source code. Your instructions are perfect timing and I am so grateful for the explanations. After I go through each step, I'll come back here to report if I have questions or breezed through.
So, yep, you have been a huge help and I am grateful you being thorough!
:-)
If you are replacing all of
If you are replacing all of the packages with those from karmic, is there a benefit to upgrading a server from 9.10 to 10.04?
Thanks for your post.
me: http://aaroncouch.info
my work: http://nuams.co
re: If you are replacing all of
Yes, there are a few benefits to upgrading. Besides getting upgraded version of almost every package (except PHP of course), 10.4 is a long-term support release ( LTS) which means 5 years of support (for servers - desktop is 3 years). A non-LTS server only gets 18 months.
We've posted some instructions and files here that might help:
http://groups.drupal.org/node/72718
Thanks!
Greg
--
Greg Coit
Systems Administrator
http://www.chapterthree.com
Better Solution is to patch ImageAPI
Tried this solution and it had all kinds of messy, unintended consequences. Then I found this nice patch for ImageAPI which solved this problem more elegantly.
http://drupal.org/node/540486#comment-2616056
There are still a whole bunch of other modules that throw warnings, but not planning on using php 5.3 on a production server anytime soon
I needed reinstall libapache2-mod-php5 as well
Hi nenne,
this is a great description, but in my machine needed another step: reinstalling libapache2-mod-php5 as well, because the command line PHP became 5.2, but the one runs inside Apache remained 5.3. The steps I taken:
I created a file /etc/apt/preferences.d/libapache2-mod-php5 with the following content:
Package: libapache2-mod-php5
Pin: release a=karmic
Pin-Priority: 991
Then issued the command:
sudo apt-get install libapache2-mod-php5
.Finally restarted Apache:
sudo /etc/init.d/apache restart
orsudo apache2ctl -k restart
I'd say it would be far
I'd say it would be far better to use this opportunity to track down individual instances of PHP 5.3 incomparability, report any problems to the relevant module maintainers, and submit patches if you can. We don't want to have to tell people to run out dated, insecure software so that they can run Drupal properly, what kind of image does that send out?!
--
Tom
www.systemseed.com - drupal development. drupal training. drupal support.
Totally agree with you
I refuse to follow this or similar tutorials out there to downgrade PHP on lucid.
The smart thing to do is to file bug reports & patches to contrib modules you find that don't work with this version of PHP.
I completely agree with mrfelton & Manuel Garcia...
+1 ;-)
Saludos
Isaac.el.Cec
- Temas DRUPAL: http://drupal6.propium.org
- Güep profesional: http://www.jramonet.org
Agreed
And I agree with all three above. Mac OS X 10.6.4 (Snow Leopard) comes with PHP 5.3.1. I'm now trying to figure how to get php working again. While apache seems to be fine after my jumping through some hoops.
Good point Tom. Love yr site
Good point Tom. Love yr site btw.
me: http://aaroncouch.info
my work: http://nuams.co
Full Pin List
Hey all,
I ended up needing to pin a bunch of packages before I could make this work. I also included the pin php5-mcrypt which is a dependancy for phpmyadmin.
PS, for noobs, this can all go into one pin file, which can be named anything, under /etc/apt/preferences.d/
Package: libapache2-mod-php5
Pin: release a=karmic
Pin-Priority: 991
Package: php5
Pin: release a=karmic
Pin-Priority: 991
Package: php5-common
Pin: release a=karmic
Pin-Priority: 991
Package: php5-mysql
Pin: release a=karmic
Pin-Priority: 991
Package: php5-gd
Pin: release a=karmic
Pin-Priority: 991
Package: php5-mcrypt
Pin: release a=karmic
Pin-Priority: 991
Package: php5-cli
Pin: release a=karmic
Pin-Priority: 991
then ran
sudo apt-get install libapache2-mod-php5
sudo apt-get install apache2 php5 php5-mysql php5-gd mysql-server php5-cli
Now you just have to worry about your Apache configurations, and your /etc/hosts file for your localhosts.
My quick recipe for Lucid with PHP 5.2
Here is my quick recipe for Lucid Lynx 10.04 with PHP 5.2.