Page 1 of 1

Getting errors trying to run GD from Perl module.

PostPosted: 22. November 2012 00:07
by hsi88
I have the Uber-uploader that has been altered over the years. The code that I'm describing below has worked fine in the past without change, and it works fine on the hosted website.

This is the statement in my perl script that gets it going: use GD;

I just got XAMPP installed on my thumb drive. According to the Perl info page, GD is installed. I moved my entire website onto my thumb drive and it runs things pretty well. But this perl upload script is having issues. It uses GD to compress images at the same time. But gets these errors in the log:

AH01215: Can't load 'G:/xampp-portable/perl/vendor/lib/auto/GD/GD.dll' for module GD: load_file:The specified module could not be found at G:/xampp-portable/perl/lib/DynaLoader.pm line 190., referer: http://localhost/hsi/hsi_photo/uu_file_upload.php
AH01215: at G:/xampp-portable/cgi-bin/uu_upload.pl line 71., referer: http://localhost/hsi/hsi_photo/uu_file_upload.php
AH01215: Compilation failed in require at G:/xampp-portable/cgi-bin/uu_upload.pl line 71., referer: http://localhost/hsi/hsi_photo/uu_file_upload.php
AH01215: BEGIN failed--compilation aborted at G:/xampp-portable/cgi-bin/uu_upload.pl line 71., referer: http://localhost/hsi/hsi_photo/uu_file_upload.php

The GD.dll file is exactly where it says it is not. I also get a pop-up window that spits out this message:

perl.exe - Unable To Locate Component - This application has failed to start because libgd-2_.dll was not found. Re-installing the application may fix this problem.

Not sure how to proceed. I assumed that the installation of XAMPP would have taken care of all of this. Any ideas??

Thanks ahead of time!
Bob

Re: Getting errors trying to run GD from Perl module.

PostPosted: 22. November 2012 12:08
by Nobbie
GD.dll is probably a compiled set of C Routines. In order to load a DLL successfully, you need to have the according C Runtime Library installed, which are called "Redistributable Package". Each Version of Microsoft C++ (ie. Visual C++) comes with its own Redistributable Package.

You need that package of the C++ which was used to compile GD.dll - either Microsoft Visual C++ 2008 Redistributable Package (x86) or Microsoft Visual C++ 2010 Redistributable Package (x86) or Microsoft Visual C++ 2006 Redistributable Package (x86) - i dont know which one exactly. Many different software products needs theses Packages as well, so very often these are already installed on your PC. It seems that the special one you need is not installed.

Simply give it a try and download and install one or all of these packages (you can get them at Microsoft freely, Google will help you). After each install you should try to run your project again and see, if it helped.

Re: Getting errors trying to run GD from Perl module.

PostPosted: 26. November 2012 23:55
by hsi88
My machine has "Microsoft Visual C++ 2008 Redistributable Package (x86)" installed.

I find it odd that Dynaloader cannot find files that are exactly where Dynaloader says they don't exist. I would think that if a module is located where it should be, everything would be Ok. Not so...

I'm guessing that Windows is somehow connected to this problem, but I am no expert at distributed operating systems. I just code scripts and modules and when they don't work because something is not installed properly, I am completely out of my element. I see people talk about entering Perl commands. I don't have a clue where you would do such a thing. Is there some sort of shell or user interface for Perl?

Coding Perl scripts is a snap. Trying to maintain the Perl infrastructure is a nightmare for me. So I will probably look for an all PHP solution.

I think I will probably rewrite the upload scrpt in PHP now that PHP allows for the interaction required for a status bar. PHP seems to have lots less problems with environment issues. I see a lot less errors, including the dreaded "End of script output before headers:". I get this all the time in Perl and almost never see it in PHP. General support for PHP seems to be lots greater as well. The documentation almost always includes good examples. Something that has served me well.

Oh well, thanks for your help.