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

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
Copy the characters (respecting upper/lower case) from the image.