PECL/PEAR Upload Progress

Submitted by admindm on Tue, 10/30/2012 - 13:04

Some Drupal modules have the ability to display a progress bar while uploading. First we need to ensure all the dependencies are installed before we can install uploadprogress itself. Run this

sudo apt-get install php-pear php5-dev build-essential

You will be asked to confirm the installation and then the installation should proceed. This will install "php-pear", "php5-dev", and "build-essentials". All of which are required to install uploadprogress.. Now we need to install the upload progress libraries themselves. Run this.

sudo pecl install uploadprogress

You will be greeted by a message stating that the build process completed and an indication that uploadprogress needs to now be activated

ubnutu server uploadprogress install

To actually get our server to use the upload progress library we need to create a .ini file to tell php to load the extension. The cleanes way to do this is to add a module dedicated .ini file in /etc/php5/apache2/conf.d. to do this open a text editor.

sudo nano /etc/php5/apache2/conf.d/uploadprogress.ini

Then add this to the file

; activate and configurate for php uploadprogress module
extension=uploadprogress.so

Now php knows to load the uploadprogress extension when it loads we just need to restart Apache to make sure the new configuration gets activated.

sudo service apache2 restart

A little later on when Drupal is installed and you check the status report you should see this near the bottom.

Drupal pecl uploadprogress installation