How install PECL uploadprogress in PHP?

Question: 

uploadprogress is a PHP extension used by scripts to display progress of the files being uploaded. For example the very popular Drupal CMS recommends using PECL uploadprogress extension.

You might be wondering how to install it when Drupal complains it doesn't see this extension?

Answer: 

You can install the uploadprogress PHP extension by using the PECL extension manager. In most Linux distributions simply launch the following command in the command line to get uploadprogress installed:

pecl install uploadprogress

You'll also need to enable the extension, so that it's recognised by your PHP/Apache instance. On a Debian machine simply create a new file called uploadprogress.ini in /etc/php5/mods-available with the following text in it:

extension=uploadprogress.so

and finally enable the extension by running:

sudo php5enmod uploadprogress

and restart Apache:

sudo service apache2 restart

Remember that prior to installing the uploadprogress extension you also need to install the phpize utility, that is part of the php5-dev package on Debian.

If your using a different Linux flavour please do check your packet manager to find and install the appropriate package.

Note: If you're on Drupal you can go to http://www.yoursite.com/admin/reports/status/php to check your PHP's installation status and verify if the uploadprogress extension has been successfully enabled. Of course, replace www.yoursite.com with your actual domain name :)

Tags: