Installing the PEAR/PECL uploadprogress extension for Drupal 7

September 16th, 2009 Posted in System administration | No Comments »

Trying out the latest development snapshot of Drupal 7, I noticed it supports the uploadprogress PEAR/PECL extension, which apparently lets you see the actual progress (with some kind of Ajaxy widget) while uploading files. Sounds cool to me.

First, I installed PEAR (on my Ubuntu testing server):

$ sudo aptitude install php-pear

and then tried to use PEAR to install uploadprogress:

$ sudo pear install pecl/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

PHPize? What’s that? There’s no phpize package; aptitude search phpize gives nothing.

A bit of digging and I found that PHPize is part of the php5-dev package! After installing that, pecl can install a module just fine:

Solution

$ sudo apt-get install php5-dev
$ sudo pear install pecl/uploadprogress

After lots of output, PEAR left a final clue:

configuration option "php_ini" is not set to php.ini location
You should add "extension=uploadprogress.so" to php.ini

So I created /etc/php/conf.d/uploadprogress.ini, containing just this line:

extension=uploadprogress.so

I restarted Apache and now Drupal 7 reports “UPLOAD PROGRESS: Enabled”. Now to try it out….!