Adding PECL Uploadprogress to 1&1 shared hosting for Drupal 7 (updated)

Drupal 7.x is the platform we use to build great websites. There are modules that allow the ability to update a progress meter when uploading a file. This requires installing a PECL extension to PHP called uploadprogress. Here is the process I used to get it working on a 1and1.com hosting package. You will need a hosting package with ssh support currently the Business and Developer packages do.

  • Download PECL uploadaccess to your 1&1 account
  • Extract the package
    tar xvzf uploadprogress-1.0.3.1.tgz
  • Go into the directory
    cd uploadprogress-1.0.3.1
  • Run phpize5.5
    phpize5.5
  • Change php-config to php-config5.5 in configure script
    sed -i 's/=php-config/=php-config5.5/g' configure
  • Run Configure
    ./configure
  • Change include directives in Makefile
    sed -i 's#-I/usr/include/php#-I/usr/include/php5.5#g' Makefile
  • Run make and make test
    make
    make test
  • Make new extensions folder for new extension to go in
    mkdir ~/extensions
  • Copy uploadprogress extension to new folder
    cp .libs/uploadprogress.so ~/extensions/
  • Create new php.ini under your main folder (or under a single subfolder for just that application) to add new extension_dir then add this code to the file
    extension_dir=/kunden/homepages/6/d87663654/htdocs/extensions/
    extension=uploadprogress.so

That should be it. You should now be able to see the “Upload progress Enabled (PECL uploadprogress)” on the admin/reports/status page in Drupal.

Links that helped me with the above info:

This is an update from the original Drupal 6 article. (http://jheslop.com/2009/05/27/adding-pecl-uploadprogress-to-11-shared-hosting-for-drupal-filefield/) Just thought I would pass along as it was a little different that the previous article.

Tips on adding PECL uploadprogress to your PHP scripts

I’ve been working on adding PECL Uploadprogress support to the drupal viddler module to give the user a better indication of how long the upload process will take. In this process I ran into a few gotchas that I thought I would pass along.

  • Make sure to have the UPLOAD_IDENTIFIER hidden element before your file input element. Otherwise it won’t be able to find your uploaded file to monitor.
  • Use the example code provided to make sure your uploadprogress extension in php is actually working. Since moving to Snow Leopard which is an 64bit OS the module would load, but not work properly. I had to download the latest version for php and put it in the php extensions folder.
  • If you do anything else after the upload that holds up the form from posting (ie http post to another server) expect the timing for the upload progress to only show the upload to the server’s local disk not the remote call.

I’m sure there were other things I ran into, but these were the major ones. Good luck and happy coding!

Adding pdftk to 1and1 shared hosting

UPDATE 2010-09-03: I updated a couple links to reflect newer downloads. Because 1and1 shared hosting is on an older debian (etch) system I had to tweak the steps for using lenny based packages. ENJOY!

There are some cases where you might need a powerful pdf toolkit to use with php. 1and1 does not come with any built in pdf processors or pdf libraries built into php. Here is the process I used to integrate phptk into my 1and1 shared hosting account.

Requirements: 1and1 shared plan that has ssh support

– Download pdftk deb file for debian lenny:

wget http://ftp.us.debian.org/debian/pool/main/p/pdftk/pdftk_1.41-3_i386.deb

– Extract the pdftk deb file:

ar xv pdftk_1.41-3_i386.deb

– Extract the data.tar.gz file:

tar xvzf data.tar.gz

– Download libgcj deb file for debian lenny:

wget http://ftp.us.debian.org/debian/pool/main/g/gcj-4.2/libgcj8-1_4.2.4-4_i386.deb

– Extract the libgcj deb file:

ar xv libgcj7-0_4.1.1-20_i386.deb

– Extract the data.tar.gz file:

tar xvzf data.tar.gz

– Download libstdc++ deb file for debian lenny (backport file http://packages.debian.org/lenny-backports/i386/libstdc++6/download):

wget http://mirror.linux.org.au/backports.org/pool/main/g/gcc-4.3/libstdc++6_4.3.4-6~bpo50+1_i386.deb

– Extract the libstdc++6 deb file:

ar xv libstdc++6_4.3.4-6~bpo50+1_i386.deb

– Extract the data.tar.gz file:

tar xvzf data.tar.gz

– Create a script to link libgcj and libstdc++6 for pdftk (use nano or vi):

#!/bin/bash

LD_LIBRARY_PATH="usr/lib:$LD_LIBRARY_PATH" usr/bin/pdftk $*

– Chmod the pdftk script so it can run:

chmod 755 pdftk

Now you can run pdftk from your main directory and process files from php or cronjobs.

If you run into any problems try running the pdftk command with some test files. If you have any problems please leave a comment. Thanks!

Adding PECL Uploadprogress to 1&1 shared hosting for Drupal FileField

Drupal 6.x is the platform we use to build great websites. There are modules FileField and ImageField 3.0 that allow the ability to update a progress meter when uploading a file. This requires installing a PECL extension to PHP called uploadprogress. Here is the process I used to get it working on a 1and1.com hosting package. You will need a hosting package with ssh support currently the Business and Developer packages do.

  • Download PECL uploadaccess to your 1&1 account
  • Extract the package
    tar xvzf uploadprogress-1.0.0.tgz
  • Go into the directory
    cd uploadprogress-1.0.0
  • Run phpize5
    phpize5
  • Change php-config to php-config5 in configure script
    sed -i 's/=php-config/=php-config5/g' configure
  • Run Configure
    ./configure
  • Change include directives in Makefile
    sed -i 's#-I/usr/local/include/php#-I/usr/include/php5#g' Makefile
  • Run make and make test
    make
    make test
  • Make new extensions folder for new extension to go in
    mkdir ~/extensions
  • Copy uploadprogress extension to new folder
    cp .libs/uploadprogress.so ~/extensions/
  • Create new php.ini under your main folder (or under a single subfolder for just that application) to add new extension_dir then add this code to the file
    extension_dir=/kunden/homepages/6/d87663654/htdocs/extensions/
    extension=uploadprogress.so

That should be it. You should now be able to see the “Upload progress Enabled (PECL uploadprogress)” on the admin/reports/status page in Drupal.

Links that helped me with the above info:

When is Daylight Savings? and 10 Things To Do With that Extra Hour


Chris Harrison twittered about a site called When is Daylight Savings? I thought I would pass along the info since we all forget at some time about when the new daylight savings time is. (In case you don’t want to go the site it is this Sun Nov. 2nd, 2008 at 3am in the morning you set your clock back to 2am). Fall back spring forward is an easy way to remember how to set the clock.

Just for fun here a few things to do with your extra hour this year or just because:

  1. Check the batteries in your smoke detectors or replace them
  2. Read about daylight savings Seize the Daylight: The Curious and Contentious Story of Daylight Saving Time or Daylight saving time – Wikipedia, the free encyclopedia
  3. Replace a regular light bulb with a new CFL light bulb
  4. Make special time with that special someone
  5. Maybe backup your computer data with mozy or jungle disk
  6. Suggest something for me to write about (in the sidebar or here)
  7. Catch up on google reader, unread blog list or a good book (reading is good for the brain!)
  8. Put the summer clothes away and pull out that winter jacket. It’s cold out there! (currently 39 degrees here)
  9. Learn about GTD and get the book
  10. Prepare a Christmas wishlist so your family will have something to get you

And finally have a good nights sleep!