Drupal 6.x And Ubuntu 8.04 (Hardy)

A few weeks ago I wrote a post about how to bring a stock CentOS 5 server up to spec to run Drupal 6. It seems only fair I do the same for Debian and Ubuntu, since it seems they too are not without their little issues when a stock install. This quick post was written after configuring a server running Ubuntu 8.04.2 (or Hardy Heron, as it was codenamed).

The first (and main) problem with a stock Debian install is it does not include the necessary GD support for manipulating images. There is a long internal squabble in the Debian ticketing system here:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=321237

At the end of that squabble, when the dust settled and the maintainers went away to grumble about the stupid users, someone finally posts something useful:
http://drupal.org/node/134331#comment-983886

Yay Drupal.org! =)

Follow the instructions in that comment and you'll have GD the way you need it. Just in case they go an get lost, I'll double them here:

Open a command line interface & add following 2 lines to /etc/apt/sources.lst

deb http://packages.dotdeb.org stable all
deb-src http://packages.dotdeb.org stable all

then run > apt-get update
run > apt-get install php5-gd
( it will complain about non-authenticated sources .. just ignore, it will also update some additional php libs , keep local modified php.ini )

run > /etc/init.d/apache2 restart

done ... you'll enjoy this one

modified packages come from > http://www.dotdeb.org/ > they provide upgraded packages for LAMP stacks

Djamu

Next problem is some missing PECL stuff. You get this a bit with CentOS too, in so far as while much of it is bundled, most of the PHP libraries and modules that are additional have been compiled for the "wrong" version of PHP once you've updated. But anyway, that's an aside... we're on Debian. And the main thing you'll want to install is uploadprogress. Drupal specifically asks for it (I think - or if not core, popular contrib).

So actually as a comment on my CentOS post, fellow Drupal developer George Hazlewood left a good clue. He mentions installing php-pear to install PECL libraries without digging around for RPMs or DEBs. I decided to try this out:

apt-get install php-pear

Then try installing uploadprogress as he suggests:

pecl install uploadprogress

And slammed in to an error about protocals:

pecl.php.net is using a unsupported protocal - This should never happen.

Fortunately I quickly found a blog post that solved this one:
http://d4ly.com/2009/08/23/fixing-unsupported-protocal-errors-when-insta...

I knew my PHP installs were done within /usr, so I found the PEAR .channels/ directories with

[~] $ cd /usr
[/usr] $ sudo find . -type d -name .channels
./lib/php/.channels
./share/pear/.channels

deleted them

[/usr] $ sudo find . -type d -name .channels -exec rm -rf {} \;

and then updated the channels

[/usr] $ sudo pear update-channels

Now installing extensions from PEAR and PECL is back to normal.

Following those instructions fixed it for me. Hopefully you won't have that particular problem at all. Time for the next php-pear error:

# pecl install uploadprogress
downloading uploadprogress-1.0.1.tgz ...
Starting to download uploadprogress-1.0.1.tgz (8,536 bytes)
.....done: 8,536 bytes
4 source files, building
running: phpize
sh: phpize: not found
ERROR: `phpize' failed

Doh!! Seems phpize is part of the php-dev package, which must also be installed. Now at this point I'm not too comfortable with this approach any more, because installing anything marked -dev is not generally considered to be a great idea. Lots of people do it without issue, so I forged on in the end, but it's worth noting that the other option is to find a pre-built .DEB file to install if you don't want to do all this.

So, install php-dev *and* make so php-pear has all the bits it needs to be able to build our additional packages:

apt-get install php-dev make

Now running the original PECL install command again works. That's it. We're done. Debian/Ubuntu now has the PECL and GD bits it needs to run Drupal. =)

Edit: don't forget (like I did) to add this line to php.ini:

extension=uploadprogress.so

Whatever you do...

... stop and think! You will install packages from non authenticated repositories to your installation.

That's all fine, until you run into dependency problems due to versions.

I followed this tutorial to get GD working on 8.04 with Drupal a few weeks ago. I just installed the latest version of drush. As soon as I wanted to use it, it started to complain about sqlite.

I didn't have php5-sqlite so I wanted to install that. But no dice! Instead of installing, aptitude told me that 'php5-sqlite is broken'.

Why?

The dotdeb version php5-sqlite requires libsqlite 3.5. But the Hardy universe repo's only contain libsqlite 3.4. So, rather then upgrading, aptitude wants to uninstall all the dotdeb packages.

So, what you really want to do is rather then fetch packages from dotdeb, is try to look for an upgrade path within universe.

True

So, what you really want to do is rather then fetch packages from dotdeb, is try to look for an upgrade path within universe.

But if there isn't one?
(I don't believe there was at the time of writing, perhaps there is now.)

Sure, there's the potential to have dependency issues if you update certain applications which others may be depending upon - but that's nothing do to with whether or not a repo is "authenticated" or not. However you update, you'll still have this problem.

So either work through the dependency hell, if you must - or stick with stock Ubuntu and wait patiently for fixes. Same for any distro.

The PECL uploadprogress thing...

...causes lots of headaches for people... I've compiled the solution I used here:
http://essentialtech.co.nz/drupal_blogs/pecl_upload_progress_bar_install...

Hope that helps

Steve
(Ubuntu 8.04, Drupal 6.14)

More details ...

There is no need to add third party repositories.

Here is an article on installing a dedicated server or a vps with Ubuntu Server 8.04 LTS (Hardy Heron) and Drupal 6.x in full detail.

And yes, aptitude is better than apt-get.

Thank you

Useful post. =)

In my case the box was already set up so it wouldn't have helped me, but from a "stock" Ubuntu Hardy image those instructions are perfect. Two things:

1. It doesn't mention the uploadprogress stuff?

2. If php-gd is already there, it is probably just for Ubuntu and not Debian? The Debian bug report I linked to implies it does not include it. Do you know if that's correct?

Aptitude is your friend

If you use aptitude instead of apt-get to install the scary *-dev packages and their dependencies you can safely remove them afterwards with a simple aptitude remove php5-dev make. In this instance they are only build-time dependencies.

Is there a difference?

I didn't realise there was a difference? You can also apt-get remove php-dev... =/

aptitude remove... also

aptitude remove... also removes unused dependencies (assuming you installed with aptitude).

However, it appears recent versions of apt-get can do this for you too: http://www.psychocats.net/ubuntu/aptitude

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <blockquote>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.