Wilson1000 has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

Im having serious trouble understanding GD.pm

I have to use it for image uploads and re-sizing for a friends website.

There are files included in the tarball called: MANIFEST, ChangeLog, META.yml and gd.xs. I have no idea what these are, maybe modules? If they are modules, I'm having issues understanding the tutorial listed on your site, this is because i'm not very familiar with some terms used to discribe certain technicalities.

I call upon your perl wisdom to guide me through the preperation of the files and where they should be placed on a server

I thank you in advance

Edited by planetscape - removed center tags

( keep:1 edit:17 reap:1 )

  • Comment on How do I install GD.pm on my UNIX server? (without root access)

Replies are listed 'Best First'.
Re: How do I install GD.pm on my UNIX server? (without root access)
by Joost (Canon) on Sep 23, 2006 at 22:26 UTC
    If you want to install a perl module in a specific directory that you have write access to (instead of the default system dirs) you could start with something like:
    # unpack the tarbal and cd to the created directory (the one containin +g Makefile.PL) > LIB=$HOME/lib perl Makefile.PL > make > make test # check to see if the tests are successful > make install
    This should install the perl module into $HOME/lib. If you want to use the module, you should make sure $HOME/lib is in the module include path. One way to do that is to put use lib "$ENV{HOME}/lib"; before the use GD; line.

    Note that you should ALWAYS try to install modules by using the perl Makefile.PL ... make install route unless you can't - lots of modules require more than just copying to configure them for your system - for one thing, like GD, many require a translation and compilation of XS code (this also means you will need a C compiler to create those modules).

    update: see also perlfaq8 and ExtUtils::MakeMaker

Re: How do I install GD.pm on my UNIX server? (without root access)
by Corion (Patriarch) on Sep 23, 2006 at 20:25 UTC

    Which terms are you unfamiliar with? Which certain techniques are you uncertain with?

    As you've been told in the CB already, you need a C compiler that can compile the XS extension, because GD is not a pure Perl extension but relies on a C part. I've pointed you to our Tutorials, A Guide to Installing Modules and Installing Modules on a Web Server.

    If all you want is to resize JPEG pictures, often there is the jpegtrans tool suite (cjpeg and djpeg) installed which you can run as command line tools to resize images without compiling anything.

Re: How do I install GD.pm on my UNIX server? (without root access)
by tinita (Parson) on Sep 24, 2006 at 10:14 UTC
    you might try cgipan. but it's not very well documented, and you should already have an idea in which directory you want to place your built modules.

    cgipan is only necessary if you have no shell access, but i use it regularly although i have shell access. i find it quite handy.

Re: How do I install GD.pm on my UNIX server? (without root access)
by stonecolddevin (Parson) on Sep 25, 2006 at 00:00 UTC

    I'd say the failsafe way to go would be ask your system administrator to do it for you, that way it's globally available on the system for certain.

    meh.

      Thanks for your help, I really appreciate it.

      Damien