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:

29 thoughts on “Adding PECL Uploadprogress to 1&1 shared hosting for Drupal FileField

  1. Pingback: Best Rated Web Hosting - Best Web Hosting 2009 | Adding PECL Uploadprogress to 1&1 shared hosting for Drupal …

  2. Pingback: Adding PECL Uploadprogress to 1&1 shared hosting for Drupal … | webhost-reviewer.com

  3. Pingback: Adding PECL Uploadprogress to 1&1 shared hosting for Drupal … | hostingrefugee.com

  4. I’m not a Christian but dude – God bless you! 🙂

    I have been tearing my hair out with 1&1 as I didn’t know how to get PECL extensions to work in their shared hosting with SSH package. We’ve hosted with 1&1 for nearly 3 years, I recommended them to my boss because they had such a good write up, I have regretted it ever since because PECL and PEAR couldn’t work with it. My boss refused to let us move because it’s such a hassle and everything mostly works.

    And now your tip here enables me to install all the PECL extensions I need – yay for you – and obviously Jesus as well if you’re that way inclined 🙂

    Hang on – I’ll let you know if it all works the way it should…

  5. mmm… didn’t work for geoip. ERROR: Cannot run tests without CLI sapi.

    and no .so file… so never mind I build without geoip…

  6. Up to now I do not have any experience with Drupal – nevertheless I here very ofteh a lot of good things about it. Maybe I should give Drupat a try.

  7. Jeremy,

    thanks for publishing this. I have created a few Drupal empoered sites most of which have been hosted with 1and1 and those hosting options already had this installed.

    I have however now opted for a 1and1 managed linux server and this extension no longer exists so I can follow your instructions and install it myself.

    My starting point though is where exactly do I download the tar to, which folder ? I’m noew with linux, relying on my unix memory from 20 years ago to fumble my way around lol.

    Anyway, any pointers greatly apperciated.

    Thanks,
    Keith

  8. Keith,

    It doesn’t matter where you upload the tar file. Just as long as the uploadprogress.so file is where it needs to be for the php.ini file to pick it up.

    Jeremy

  9. Nice 🙂

    This helped quite a bit; I keep forgetting that 1and1 defaults to php4 >.>

    Anyway, I had to do things slightly differently, which isn’t had for someone familiar with makefiles to figure out, but perhaps this will help someone who isn’t:

    *Don’t bother changing php-config to php-config5, just run ./configure like normal
    *Your include directives line should look like this:
    INCLUDES = -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend
    , instead of ‘-I/usr/local/include/php#-I/usr/include/php5’, as the original post says
    *make test didn’t work for me
    *Your .so and .la files end up in ./modules, so you’ll need to execute this:
    cp uploadprogress.so ~/extensions/
    , instead of ‘cp .libs/uploadprogress.so ~/extensions/’

    As I said, these are things I had to do differently….not saying the original post is wrong, things may have just changed, or the account I’m working on may just be weird XD

  10. Very useful. We have been looking for a progress bar to enhance our book upload component we are developing. Really important to give users feedback on what is going on otherwise they start clicking on all sorts of things and break the process!

  11. Hi,

    all was going well following your instructions until I got to “sed -i ‘s#-I/usr/local/include/php#-I/usr/include/php5#g’ Makefile” at which point I get an error:

    “sed: can’t read Makefile: No such file or directory”

    I’m quite good at following instructions but I’m at a total loss as how to resolve this. Googling hasn’t helped and Epic_Tank’s alternative fared no better for me.

    Could you make any suggestions or point me in the right general direction?

    Much appreciated!

  12. Mik F,

    Did you

    cd uploadprogress-1.0.0

    or cd uploadprogress-1.0.1
    or cd uploadprogress-1.0.2

    to whichever version you have first? There should be a Makefile in there. If it is called makefile. You can use this command:

    sed -i ‘s#-I/usr/local/include/php#-I/usr/include/php5#g’ makefile

  13. we are now in 2011 and i had to do this on a managed server of 1&1 – here is the feedback and what i did:

    * Download PECL uploadaccess from http://pecl.php.net/get/uploadprogress to your 1&1 account
    * tar -xvzf uploadprogress-1.0.1.tgz
    * cd uploadprogress-1.0.1
    * ./configure
    * sed -i ‘s#-I/usr/local/include/php#-I/usr/include/php5#g’ Makefile
    * make
    * mkdir ~/extensions
    * cp modules/uploadprogress.so ~/extensions
    * in php.ini:
    extension_dir=/kunden/homepages/foo/foo/htdocs/extensions/
    * and important in a new line in php.ini:
    extension=uploadprogress.so

  14. I’m trying to add PECL Uploadprogress to 1&1 shared hosting and I’m glad that I found your blog. You made it look simple and easy to do. I will try your advice and see how it goes.

  15. I tried this and the flow stopped at step:
    # Change include directives in Makefile
    sed -i ‘s#-I/usr/local/include/php#-I/usr/include/php5#g’ Makefile

    Note that there is no Makefile created prior to this, only a file Makefile.global Is this the same thing? I ask because I can find no instance of the text within Makefile.global that you are requesting be changed.

    I am on the new dual server Linux hosting plan. Thanks!

    ..
    08/17/2011 07:58 PM 75,494 acinclude.m4
    08/17/2011 07:58 PM 305,818 aclocal.m4
    08/17/2011 08:04 PM build
    08/17/2011 07:58 PM 44,892 config.guess
    08/17/2011 07:58 PM 379 config.h.in
    08/15/2011 08:21 AM 367 config.m4
    08/17/2011 07:58 PM 33,387 config.sub
    08/15/2011 08:21 AM 303 config.w32
    08/17/2011 07:58 PM 360,890 configure
    08/17/2011 07:58 PM 4,909 configure.in
    08/17/2011 08:04 PM examples
    08/17/2011 07:58 PM 0 install-sh
    08/17/2011 07:58 PM 199,728 ltmain.sh
    08/17/2011 07:58 PM 5,306 Makefile.global
    08/17/2011 07:58 PM 0 missing
    08/17/2011 07:58 PM 0 mkinstalldirs
    08/15/2011 08:21 AM 3,676 php_uploadprogress.h
    08/17/2011 07:58 PM 71,364 run-tests.php
    08/15/2011 08:21 AM 15,924 uploadprogress.c

  16. Wow! It worked! Thanks!

    Side notes:
    Of course if you use wget to get the latest release as of today the directory that is created is uploadprogress-1.0.3.1.

    Additionally I am sure this is obvious because it is obvious to me as someone really new to all this, but you must enter your own website file structure in the php.ini and not the example here because it will be different for every account you have with 1and1, i.e. maybe
    /kunden/homepages/12/d373759082/htdocs for one account and
    /kunden/homepages/11/d373759888/htdocs for another.

    If you are using PuTTY just do a cd .. to see what your directory structure is named and then do a cd htdocs to get back to your root directory.

Comments are closed.