Perl Module Issues
Budget: $10 – $30 USD
I require advice / fixes on two perl issues that I am experiencing after migrating from a CentOS 7 server to a newly installed AlmaLinux 8 server.
Apache/2.4.37 (AlmaLinux)
Perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi
perl -V
@INC:
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
Process:
I call a URL in the browser which should return 'test...', the script is in the home directory root:apache 0750
Problem One:
The installed modules are not found.
!/usr/bin/perl -T
use strict;
use warnings;
use utf8;
# the following modules are not found but installed via dnf or cpan
use Cpanel::JSON::XS qw(decode_json);
use Data::Validate::IP qw(is_ip);
use Data::Dumper;
use DBI;
use RedisDB; # fails
print "Content-type: text/html\n\ntest...";
exit 0;
If I include the use libs, then modules are found other than for the RedisDB::Error issue mentioned in problem two.
!/usr/bin/perl -T
use strict;
use warnings;
use utf8;
use lib '/usr/local/lib64/perl5/';
use lib '/usr/local/share/perl5/';
use lib '/usr/lib64/perl5/vendor_perl/';
use lib '/usr/share/perl5/vendor_perl/';
use lib '/usr/lib64/perl5/';
use lib '/usr/share/perl5/';
use Cpanel::JSON::XS qw(decode_json);
use Data::Validate::IP qw(is_ip);
use Data::Dumper;
use DBI;
use RedisDB; # fails
print "Content-type: text/html\n\ntest...";
exit 0;
################################
Question:
---------
Why isn't the perl script finding any of the modules via Apache and how can this be fixed?
################################
Problem two:
RedisDB.pm cannot find RedisDB::Error which it installed via cpan using cpan install RedisDB
If I call via the command line then I get no errors
[root@s35 ~]# perl -e "use RedisDB"
[root@s35 ~]# perl -e "use RedisDB::Error"
httpd error log;
Can't locate RedisDB/Error.pm: /usr/local/share/perl5/RedisDB/Error.pm: Permission denied at /usr/local/share/perl5/RedisDB.pm line 9.: /home/acc/html/script.pl
BEGIN failed--compilation aborted at /usr/local/share/perl5/RedisDB.pm line 9.: /home/acc/html/script.pl
Compilation failed in require at /home/acc/html/script.pl line 13.: /home/acc/html/script.pl
BEGIN failed--compilation aborted at /home/acc/html/script.pl line 13.: /home/acc/html/script.pl
End of script output before headers: script.pl
redis and perl-redis is installed via dnf but this connects to a Redis DB on the vLan
redis::DB is installed via cpan which also installs RedisDB::Error and RedisDB::Parser::Error
################################
Question:
---------
RedisDB.pm line 9 is 'use RedisDB::Error;' so it cannot find it's own installed pm, how can this be fixed?
################################
Unfortunately I cannot give server access, but I can run commands and provide info to help problem solve.
Look forward to your feedback
Apache/2.4.37 (AlmaLinux)
Perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi
perl -V
@INC:
/usr/local/lib64/perl5
/usr/local/share/perl5
/usr/lib64/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib64/perl5
/usr/share/perl5
Process:
I call a URL in the browser which should return 'test...', the script is in the home directory root:apache 0750
Problem One:
The installed modules are not found.
!/usr/bin/perl -T
use strict;
use warnings;
use utf8;
# the following modules are not found but installed via dnf or cpan
use Cpanel::JSON::XS qw(decode_json);
use Data::Validate::IP qw(is_ip);
use Data::Dumper;
use DBI;
use RedisDB; # fails
print "Content-type: text/html\n\ntest...";
exit 0;
If I include the use libs, then modules are found other than for the RedisDB::Error issue mentioned in problem two.
!/usr/bin/perl -T
use strict;
use warnings;
use utf8;
use lib '/usr/local/lib64/perl5/';
use lib '/usr/local/share/perl5/';
use lib '/usr/lib64/perl5/vendor_perl/';
use lib '/usr/share/perl5/vendor_perl/';
use lib '/usr/lib64/perl5/';
use lib '/usr/share/perl5/';
use Cpanel::JSON::XS qw(decode_json);
use Data::Validate::IP qw(is_ip);
use Data::Dumper;
use DBI;
use RedisDB; # fails
print "Content-type: text/html\n\ntest...";
exit 0;
################################
Question:
---------
Why isn't the perl script finding any of the modules via Apache and how can this be fixed?
################################
Problem two:
RedisDB.pm cannot find RedisDB::Error which it installed via cpan using cpan install RedisDB
If I call via the command line then I get no errors
[root@s35 ~]# perl -e "use RedisDB"
[root@s35 ~]# perl -e "use RedisDB::Error"
httpd error log;
Can't locate RedisDB/Error.pm: /usr/local/share/perl5/RedisDB/Error.pm: Permission denied at /usr/local/share/perl5/RedisDB.pm line 9.: /home/acc/html/script.pl
BEGIN failed--compilation aborted at /usr/local/share/perl5/RedisDB.pm line 9.: /home/acc/html/script.pl
Compilation failed in require at /home/acc/html/script.pl line 13.: /home/acc/html/script.pl
BEGIN failed--compilation aborted at /home/acc/html/script.pl line 13.: /home/acc/html/script.pl
End of script output before headers: script.pl
redis and perl-redis is installed via dnf but this connects to a Redis DB on the vLan
redis::DB is installed via cpan which also installs RedisDB::Error and RedisDB::Parser::Error
################################
Question:
---------
RedisDB.pm line 9 is 'use RedisDB::Error;' so it cannot find it's own installed pm, how can this be fixed?
################################
Unfortunately I cannot give server access, but I can run commands and provide info to help problem solve.
Look forward to your feedback