Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Manual installation of GD or ImageMagick in local folder

by traxlog (Scribe)
on Jul 01, 2008 at 09:32 UTC ( #694911=perlquestion: print w/replies, xml ) Need Help??
traxlog has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I have a client that insists on using a particular hosting service which unfortunately will not install either the GD or ImageMagick libraries for Perl. My software currently relies on ImageMagick for thumbnail production and general resizing.

Currently I'm using an external PHP script called via an HTML IMG tag to do the dirty work (the GD library is in place for the PHP installation), but of course that's far from ideal.
I'm wondering if it's possible to tweak the GD or Imagemagick installation to install in a local folder which I could upload to the server and "use GD;"?

Here's the catch: I have only ftp access to the server, so any tweaking will have to be done first.

Anyone have experience in these matters?

Maybe other suggestions? Any help appreciated thank you!
  • Comment on Manual installation of GD or ImageMagick in local folder

Replies are listed 'Best First'.
Re: Manual installation of GD or ImageMagick in local folder
by jettero (Monsignor) on Jul 01, 2008 at 10:52 UTC
    It is definitely possible.

    This is from ExtUtils::MakeMaker:

    perl Makefile.PL INSTALL_BASE=/path/to/your/home/dir

    Then you just use lib "/path/to/your/home/dir" in your CGI and you're done.

    You can automate this strategy by setting your cpan shell variable 'makepl_arg' to include the INSTALL_BASE make argument.

    (This is not the first time the question has been asked. I know I've asked it myself before, but I think my answer is slightly different than other answers I've seen.)

    UPDATE: PREFIX may even be better or more appropriate, not really sure. But my strategy above remains the same.


      I usually do something similar to Paul's strategy above, but I use PREFIX which is available in almost all perl packages I've encountered.

      % perl Makefile.PL PREFIX=/usr/home/USERNAME

      One hiccup, since neither of your modules are pure perl, and you lack access to your server, you'll want to compile them on a machine as close to your target server as possible, at the very least using the same operating system.

      Honestly you may want to explain some of this to your client. If they are using a substandard hosting company that lacks the tools you need to get things running, they should be made aware of this. If your clients ignore your advise and expertise, they may not be worth your time.

      Another possibility is to host the application on a different server and fetch the images via AJAX requests.

Re: Manual installation of GD or ImageMagick in local folder
by traxlog (Scribe) on Jul 01, 2008 at 13:09 UTC
    Thanks for your replies.

    I've been running into error after error trying to get things going here, but there are just too many incompatibilities to make it worthwhile.
    I use os x and the server is some linux variant and there's no libgd on my machine just for starters.
    I was hoping just to "tap" into the current libgd installation by localizing and uploading a GD library, but unfortunately for me it's not that simple. I'm also a bit aprehensive about contaminating my local development platform with uneccessary/experimental installations.

    The hosting company is far from substandard, and has been highly recommended by several colleagues - none of which have needed thumbnail generation! I'm going to try some experiments via exec and system commands directly to the libraries present. Maybe I'll have more success with this.

    Thanks anyway!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://694911]
Approved by Corion
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2018-01-17 22:17 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (206 votes). Check out past polls.