Drupal 6.x And Ubuntu 8.04 (Hardy)

Tutorial on how to bring a Debian and Ubuntu server up to spec to run Drupal 6.

Photo of Greg Harvey
Mon, 2009-10-05 09:56By greg

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.tumblr.com/post/411870154/fixing-unsupported-protocal-errors...

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