Ubuntu 10.04 and Drupal
on
Ubuntu 10.04 and Drupal
If you install Ubuntu 10.04 and you're running Drupal sites, you may want to downgrade the installed PHP 5.3 to 5.2, as though recent Drupal core is mostly 5.3 compatible, some contributed modules aren't yet.
Owen Barton pointed me to this handy set of PHP downgrade instructions that had worked for him. These instructions purge the current PHP5 apps, "pin" the apps to the karmic (9.10) repository, add the karmic repositories to your source list, and then reinstall the primary apps (php5-cli, php5-cgi and libapache2-mod-php5).
This all worked for me, too, but I have a couple additional suggestions:
First, before you start, run:
php_installed=`dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
This saves a list of the additional PHP apps and libraries that you'll want to re-install when you're done. You can view them easily, of course, with:
echo $php_installed
Then run KAndy's script. Once complete, to get the rest of your installed PHP packages, run:
sudo apt-get install $php_installed
This worked for a lot of my packages, but one of my packages was phpmyadmin which required php5-mcrypt, both of which are in the "universe" repository rather than the "main restricted" one. So I added these four lines to my /etc/apt/sources.list.d/karmic.list file:
deb http://archive.ubuntu.com/ubuntu/ karmic universe
deb http://archive.ubuntu.com/ubuntu/ karmic-updates universe
deb http://archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://archive.ubuntu.com/ubuntu/ karmic-updates multiverse
After running "apt-get update" again, I was able to add all of the rest of my packages. Instead of adding these manually, you could also replace line #10 in KAndy's script with:
egrep '(main restricted|universe|multiverse)' /etc/apt/sources.list|grep -v "#"| \
sed s/lucid/karmic/g | sudo tee /etc/apt/sources.list.d/karmic.list > /dev/null
I'm really enjoying Ubuntu 10.04. And so is my wife as it has fixed several stability issues on her Dell laptop. I think you will, too!
Thanks for sharing this insightful post on Ubuntu 10.04. This takes some working to achieve.
The specific modules that have issues with php 5.3 include date and calendar.
The core modules and many others seem OK re php 5.3.
Thanks, this is a good post to be writing right now. I am currently using a development machine and Drupal gives a number of warnings. It is possible, as an earlier commenter mentioned, to ignore these deprecation warnings, but is this really the way to go? I'd prefer to know that there were no warnings rather than sweeping them under the carpet.
So I've followed the instructions however I'm getting an error when I run apt-get for the $php_installed
Invalid record in the preferences file /etc/apt/preferences.d/php, No package header.
Any ideas?
I just started setting up a Drupal development machine last night using Ubuntu 10.4, but hadn't yet loaded Drupal. I had completely forgotten about the compatibility issue with PHP 5.3, so your timing could not be more perfect. Thanks!
Rather than systematically downgrade, I try to develop on php 5.3, and file patches to the modules that break. Given that 10.04 is a LTS release, hosting platforms will likely start running php 5.3, so it seems vital that Drupal also run on php 5.3.
Additional information and lots of useful comments on how to approach different solutions for this downgrade can also be found on http://nickveenhof.be/blog/reverting-or-downgrading-php-53-52-ubuntu-luc...
A step by step tutorial is also included
Which modules are breaking? I've found a few modules (date, for
example) to throw deprecation warnings, but that's all. These were
easily fixed by adding the following lines to my settings.php files (for
some reason, it's not picking up in php.ini):
ini_set('error_reporting',
'E_ALL & ~E_DEPRECATED');
Are there any other
incompatibilities you've found besides deprecation warnings?













Thanks for this very useful write up!