Can't locate GD.pm in @INC
Apologize if this is the wrong forum. I have an older perl script that has been running fine until awhile ago when I noticed this error:
[QUOTE]
fatal error: Can't locate GD.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at admin/captcha/captcha.pl line 42.
BEGIN failed--compilation aborted at admin/captcha/captcha.pl line 42.
Compilation failed in require at /home/mywebsite/public_html/links/cgi-bin/admin/db_utils.pl line 629.
I've been researching this error for days and have yet to find an explanation or solution to my problem. I've looked inside the captcha.pl at line 42 and admin/db_utils.pl at line 629 but can't see anything to point me in the right direction.
path in add.cgi is the same as db_utils.pl Looked in the usr/local and usr/lib64 and usr/share folders/files and confirm that GD isn't there. So I thought maybe GD was missing from the server but it is there. [QUOTE] # php -i | grep 'GD\|ImageMagick' GD Support => enabled GD Version => bundled (2.1.0 compatible)
I've also installed ImageMagick to see if that would fix it but still the same. I am not too familiar with perl so I thought I'd reach out here to someone who may be able to give me some direction on where I should be looking. Here are my server details: CENTOS 7.9 cPanel V94.0.4 Apache Version 2.4.46 PHP Version PHP 5.6 ( ea-php56 ) MySQL Version 5.7.33 Architecture x86_64 Operating System linux Path to Perl /usr/bin/perl Perl Version 5.16.3 Kernel Version 3.10.0-1127.18.2.el7.x86_64
I've been researching this error for days and have yet to find an explanation or solution to my problem. I've looked inside the captcha.pl at line 42 and admin/db_utils.pl at line 629 but can't see anything to point me in the right direction.
//line 42
use GD;//line 629
require "admin/captcha/captcha.pl"; # This should be the path from add.cgipath in add.cgi is the same as db_utils.pl Looked in the usr/local and usr/lib64 and usr/share folders/files and confirm that GD isn't there. So I thought maybe GD was missing from the server but it is there. [QUOTE] # php -i | grep 'GD\|ImageMagick' GD Support => enabled GD Version => bundled (2.1.0 compatible)
I've also installed ImageMagick to see if that would fix it but still the same. I am not too familiar with perl so I thought I'd reach out here to someone who may be able to give me some direction on where I should be looking. Here are my server details: CENTOS 7.9 cPanel V94.0.4 Apache Version 2.4.46 PHP Version PHP 5.6 ( ea-php56 ) MySQL Version 5.7.33 Architecture x86_64 Operating System linux Path to Perl /usr/bin/perl Perl Version 5.16.3 Kernel Version 3.10.0-1127.18.2.el7.x86_64
-
Hi, So - you get the error in a perl script and test that GD is installed in PHP? :) :) You may want to check if perl-GD is installed: rpm -q perl-GD0 -
I'd also recommend checking with a local PHP Info page instead of "php -i" as that would pull data from the system's default PHP instead of what that specific cPanel user is seeing. 0 -
Thanks for the replies. I didn't realize that GD had to be installed for every language. I thought they came installed with the package. I found this command to install perl-GD. [QUOTE] yum install perl-GD 0 -
Another question if that is alright. Is GD.pm the same as the GD library I just installed using the yum command? It is a little confusing as to whether it is a different module or .pm is the file name for GD. Thanks 0 -
GD.pm is specifically the perl module for GD, which would be the same as the yum command you ran. This is different than the more common GD software that people talk about with PHP. 0 -
cPRex, thanks for your reply. I figured that when running the yum command that GD.pm was installed but wanted to make sure as it seems there are a lot of modules for perl. 0 -
sorry inadventantly posted the same reply as earlier and couldn't find a way to delete it. 0 -
Okay after installing perl GD.pm and trying to get the captcha mod working I got this error: [QUOTE] fatal error: source is not of type GD::Image at admin/captcha/captcha.pl line 162
After some research I determined that GD::Image is a module so I ran the following two commands: [QUOTE] # rpm -q perl-GD::Image package perl-GD::Image is not installed # yum install perl-GD::Image Loaded plugins: fastestmirror, universal-hooks Loading mirror speeds from cached hostfile * EA4: 204.10.37.146 * cpanel-addons-production-feed: 204.10.37.146 * cpanel-plugins: 204.10.37.146 * base: mirror.esecuredata.com * extras: centos.mirror.netelligent.ca * updates: centos.ca-west.mirror.fullhost.io No package perl-GD::Image available. Error: Nothing to do
So I did some more research and ran this command: [QUOTE]cpan GD::Image
Which ran for quite a while prompting me to say yes or no to two temp installs named extUtils-config1.16 and MSCHWERN/Test-fork-0.02. After all was said and done I didn't get any errors and when I tried to run the rpm -q command again I got the same result[QUOTE] rpm -q perl-GD::Image package perl-GD::Image is not installed
What did I install if it wasn't GD::Image? Update: When I visited usr/local/lib64/perl5/GD/ image.pm is there. I guess that the rpm command isn't the right one to confirm GD::Image is installed on a centos 7 server. Also it looks like the previous command cpan GD::Image installed about 3-4 modules besides the image.pm module0
Please sign in to leave a comment.
Comments
8 comments