Instructions for patching php from the pdoru.ro website:
Code:
This is version 4 of the php-patch that implements the upload-progress-callback feature. Tested with php versions: 4.3.7/8/10 5.0.0/3
Quick install:
1. you need a fresh source of PHP. version 4 or 5. and just untar it.
2. change directory into the main directory of the php source tree:
cd php-4.3.7
3. apply patch
patch -p1 < /path/to/the/patch.upload-progress-callback-v4.1-phpVERSION.txt
4. configure, compile and install PHP as usual. enjoy.
when done, install the php upload_progress_meter extension
Instruction for installing the extension, also from the same site:
Code:
Quick install:
1. compile
This extension was tested with PHP versions 4.3.7/8/10 and 5.0.0/3
phpize
./configure
make
make install
Notice the directory where the extension was installed.
2. edit your php.ini and add on line like this:
extension=no-debug-non-zts-20020429/upload_progress_tracking.so
it is possible that you will need to copy it somewhere else, or to edit the extension_dir directive
in your php.ini to point to the correct path.
mine looks like this:
extension_dir = /usr/local/lib/php/extensions
and I have the extension in this place:
/usr/local/lib/php/extensions/no-debug-non-zts-20020429/upload_progress_tracking.so
3. edit php.ini or apache's httpd.conf to configure the upload-progress-tracking
I have this in my httpd.conf:
php_value upload_progress_tracking.store_method "file"
php_value upload_progress_tracking.file 1
php_value upload_progress_tracking.file.filename_template "/tmp/uploadbar/upl_%s.txt"
4. don't forget to mkdir /tmp/uploadbar ; chmod 777 /tmp/uploadbar
cPanel keeps the source/build files for apache and php in /home/cpapachebuild/buildapache Inside there you will see the directory for your version of PHP. For me, there is a directory called php-5.1.4 that houses all the php source files.
So if I were to build this onto MY server it would go something like this (keep in mind that you MUST verify directories for your own server as they may not be the same as mine).
1. Login to your cPanel server as root using SSH and navigate to the appropriate directory and download the necessary files
Code:
root@xxx [~root] cd /home/cpapachebuild/buildapache/php-5.1.4
root@xxx [php-5.1.4] wget http://pdoru.from.ro/upload-progress-meter/upload-progress-meter-v4.1/upload_progress_meter/upload_progress_meter.c
root@xxx [php-5.1.4] wget http://pdoru.from.ro/upload-progress-meter/upload-progress-meter-v4.1/php-patch/patch.upload-progress-callback-v4.1-for-php(your ver).txt
2. Then run the patch as per the instructions above
Code:
root@xxx [php-5.1.4] patch -pl patch.upload-progress-callback-v4.1-phpVERSION.txt
3. Next comes the compile process. Every user has different compile wants and needs. Read the options at ./configure --help for more info. I have given you an example below. Again, do not use my example unless those are the options that you want to use for your server.
Code:
root@xxx [php-5.1.4] phpize
root@xxx [php-5.1.4] ./configure --with-apxs=/usr/local/apache/bin/apxs --prefix=/usr/local --with-xml --with-mm --with-dom --with-dom-xslt --with-dom-exslt --enable-exif --with-swf=/usr/local/flash --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-java=/usr/local/jdk --enable-mbstring --enable-mbstr-enc-trans --enable-mbregex --with-mcrypt --with-mhash --enable-magic-quotes --with-mm --with-mysqli --with-mysql=/usr --with-openssl --enable-discard-path --with-pear --with-pspell --enable-xslt --with-xslt-sablot --enable-sockets --enable-track-vars --with-ttf --with-freetype-dir=/usr --enable-gd-native-ttf --enable-wddx --with-xmlrpc --with-zip --with-zlib --enable-soap
4. Now for the make process
Code:
root@xxx [php-5.1.4] make
root@xxx [php-5.1.4] make install
5. Follow the instructions above concerning the modifications to your php.ini file and httpd.conf file
If this does not help, you can always hire one of the experts you find in these forums to do this install for you.