Shared hosting providers present greater difficulties because you don't have root. Instead you have to compile the extensions in your local directory and somehow entice php to load your files.
I don't have access to any other providers; but Dreamhost has made this fairly painless if you have some linux shell skills. http://wiki.dreamhost.com/PHP.ini is their general FAQ on the subject. Following is a brief recipe for specifically enabling pecl/uploadprogress:
- Make sure you are using php 5.3. As of this writing, Dreamhost's default is to provide you a FCGI version of php 5.2. This can be changed to 5.3 in their control panel. (Manage domains --> edit --> PHP Mode --> choose 5.3.x CGI from the pop-up).
- Disable mod_security. This can be also done in the Dreamhost control panel under the domain settings. (Manage domains --> edit --> Extra Web Security? --> clear (uncheck) the checkbox.)
- If you are concerned about security there is a way to disable mod_security for specific web pages. See http://wiki.dreamhost.com/Mod_security for more information.
- Wait 5-10 Minutes
- ssh into your home dir on the Dreamhost machine.
- Change your PATH environment variable to include /usr/local/php53/bin ahead of /usr/local/bin (the php binaries installed in /usr/local/bin are 5.2). If you don't know how to change this, an inadequate explanation is to type:
into the default .bash_profile that Dreamhost provides. Log out and log back in. Type:
to see what your PATH contains. Also type:
to see which php you are executing. It should read: /usr/local/php53/bin/php
- Download the source for uploadprogress from pecl into some directory you find convenient:
wget http://pecl.php.net/get/uploadprogress -O uploadprogress-1.0.1.tgz
(that's an uppercase oh, not a zero)
- Extract the archive:
tar -zxvf uploadprogress-1.0.1.tgz
- Configure and compile:
You should now find the compiled extension as ./modules/uploadprogress.so
- Create a directory-tree at the root of your home directory: ~/.php/5.3
- Copy the newly created extension into the .php tree:
cp ./modules/uploadprogress.so ~/.php/5.3/
You can actually put the new library anywhere you want; but this is a logical place and what Dreamhost recommends.
- Create your own phprc file to override the default php.ini and type in a directive to load the new extension:
echo "extension = /home/[username]/.php/5.3/uploadprogress.so" > ~/.php/5.3/phprc
Substitute your own username for [username] in the above path.
- If you want instant results (you can just wait a few minutes), you have to kill any current copies of the CGI which might be running thereby forcing the config to reload:
Check phpinfo(). You should see a heading Additional .ini files parsed that lists the path to your custom phprc file. You should also see information about the module uploadprogress. Reloading the Drupal status report should also show upload progress is now enabled.
This works because php 5.3 has some additional options for runtime configuration and Dreamhost has enabled the hooks necessary to allow the use of .php in your home directory. A more elaborate solution is to compile your own version of PHP in your home directory. http://wiki.dreamhost.com/Installing_PHP5 describes Dreamhost's recommended method.
Problems? Test it first!
Before approaching the Drupal community claiming that Drupal is broken make sure uploadprogress is working by installing the test files (see attached) into http://yoursite.com/test. You can also get the test files directly from PECL at http://svn.php.net/viewvc/pecl/uploadprogress/trunk/examples/ just download them all into the same directory and run index.php. Use these test scripts first and if you see progress appear here and not on Drupal than it is a Drupal problem.
Note: When testing this make sure that the hypertext protocol is the same as what it will be when you are uploading in Drupal. I.e. If you will be uploading with http:// test with http://. If you are uploading with https://, test with https://.