18th Jul, 2009
@ 22:25
I installed the PECL uploadprogress PHP extension on my Debian Lenny development server for the Drupal filefield module just before Psynaptic's excellent roundup of how it install it on just about everything. But it turns out to be a lot easier on the Ubuntu 9.04 (Jaunty) development server I'm switching too:
sudo aptitude install php5-dev php-pear
sudo pecl install uploadprogress
sudo pecl install uploadprogress
Then add the "extension=uploadprogress.so" to your php.ini, in my case I'm using a local ini file rather than modifying the apt supplied php.ini:
sudo nano /etc/php5/conf.d/local.ini
Reload the Apache config and you're done.
Thanks for this Adrian. That worked for me on Ubuntu 8.04, except that the package is called “php5-dev” instead of “php-dev”.
Oops. It’s php5-dev on Ubuntu 9.04 too. Post now corrected. Thanks!
Roel de Meester of Krimson.be made a script that automizes this so you don’t have to manually edit with nano or vim. It goes like this:
#better uploadprogress bar
sudo pecl install uploadprogress
sudo sed -i '/; extension_dir directive above/ a\
extension=uploadprogress.so' /etc/php5/apache2/php.ini
Hmm, mollom really needs to work on its ux.
I see that the line-endings got messed up. The new lines are at:
sudo aptitude…
sudo pecl…
sudo sed…
extension=…
and the quotation marks need to be normal too.
You need to wrap code in code tags. I’ve edited your comment to add them.
@whatdoesitwant Also notice that Roel’s script edits the main php.ini, the Apt package supplied version and is likely to be overwritten with an update at some point. Much less hassle to use a local ini file as I described.
Revisited.
As a follow up, am i right to assume that your aproach of using a local.ini in the conf.d folder will add to both apache2/php.ini and cli/php.ini?
Also, do definitions in conf.d/local.ini supersede conflicting default definitions in either php.ini?
I tested and can affirm that it does.
great guide, thanks for the help :D