You are here

installing PECL upload progress on ubuntu server

Some of Drupal's CCK modules such as filefield and imagefield have support for a neat Upload Progress meter.

You may have seen a message in the status report of your Drupal site saying something like... "Upload progress not enabled - Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the PECL uploadprogress library (prefered) or to install APC."

APC is primarily a PHP accelerator (there are many others available, but APC is simple to install and will apparently be included in the core of PHP 6). It also offers some uploadprogress functionality.

The information filefield module pokes into the status report tells you how to enable this feature if you've already got APC enabled, but it also adds "it is recommended to use PECL uploadprogress, which supports more than one simultaneous upload." (see filefield.install)

Whether you're already using APC or not, it's very easy to install PECL upload progress on a ubuntu server (and no doubt on other platforms, once you've got PEAR / PECL installed successfully). Here's how:

Install PECL / PEAR

The php5-dev package is also recommended, as you'll need it to install most of the extensions from PECL.

mcdruid@some-server:~> sudo apt-get install php-pear php5-dev

Install Upload Progress

mcdruid@some-server:~> sudo pecl install uploadprogress ...lots of output as PECL downloads and compiles the extension... Build process completed successfully Installing '/usr/lib/php5/20060613+lfs/uploadprogress.so' install ok: channel://pecl.php.net/uploadprogress-1.0.1 configuration option "php_ini" is not set to php.ini location You should add "extension=uploadprogress.so" to php.ini

...then simply follow that last instruction (which I've emphasised); I put the line near the file upload section of my php.ini, but you could put it anywhere. This is where I'd expect to find the php.ini file on a server running a recent version of ubuntu:

/etc/php5/apache2/php.ini

The change will not show up until you restart apache (a force-reload doesn't cut the mustard for this sort of change):

mcdruid@some-server:~> sudo /etc/init.d/apache2 restart * Restarting web server apache2                                           [OK]

You should now have a nice reassuring message on the status report saying PECL upload progress is enabled, and next time you upload to a filefield or imagefield you should see a smart new progress meter.

Comments

This message is to tell you that your initructions worked like a charm in Ubuntu 10.04 in a VPS machine with a total newbie (yours truly). After some failures following other folks' instructions found in the Net, your page has been the best and most useful of them all.

Thank you so much. Now my Drupal 7 runs with the PECL upload progress enabled.

:) Gustavo, from a rainy Madrid, Spain

Short and to the point. Thanks!

You have no idea how many hours I've been looking online for a good explanation of how to enable Uploadprogress! I had no idea that putting extension=uploadprogress.so right under Max File Uploads would (for whatever reason) do the trick. I was placing the line right under the extension_dir line all this time. It worked for me! Thank you so much for this tutorial.

This was a very easy to follow instruction guide. Took all of maybe 5 minutes to get everything installed and written in. Now I have no warning! Thanks!