Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: cannot use Crypt::GPG for CGI

by opticalcarrier (Initiate)
on Jun 15, 2016 at 05:20 UTC ( [id://1165683]=note: print w/replies, xml ) Need Help??


in reply to Re: cannot use Crypt::GPG for CGI
in thread cannot use Crypt::GPG for CGI

ah, ok well I did that and the web server now returns
Can't locate Crypt/GPG.pm in @INC (@INC contains: /usr/local/lib64/per +l5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/per +l5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at emailprequal.c +gi line 3. BEGIN failed--compilation aborted at emailprequal.cgi line 3.
but i still dont get it. I can run the script from command line and it does everything I want. but it cant do it as a cgi with that "use Crypt::GPG;" in there at the top. even with no crypt::gpg objects in the perl script itself, if that use "use Crypt::GPG;" is there, the CGI webserver errors out.

Replies are listed 'Best First'.
Re^3: cannot use Crypt::GPG for CGI
by afoken (Chancellor) on Jun 15, 2016 at 05:54 UTC
    Can't locate Crypt/GPG.pm in @INC

    Compare @INC dumped from command line with @INC dumped from a CGI. You may need to add use lib "/some/where/"; to the CGI.

    Also compare $^X in CGI and command line. Your CGI may run using a different perl. In that case, use lib makes things worse (mixing library paths of different perl versions).

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      yes, i think you are on to something here. run from a web browser we get @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 .
      perl path
      /usr/bin/perl
      where as from CLI, the @INC is
      p>/home/hostdemo/perl5/lib/perl5/5.10.1/x86_64-linux-thread-multi /hom +e/hostdemo/perl5/lib/perl5/5.10.1 /home/hostdemo/perl5/lib/perl5/x86_ +64-linux-thread-multi /home/hostdemo/perl5/lib/perl5/5.10.0 /home/hos +tdemo/perl5/lib/perl5 /usr/local/lib64/perl5 /usr/local/share/perl5 / +usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/p +erl5 /usr/share/perl5
      path
      /usr/bin/perl
      and the module itself is in
      /home/hostdemo/perl/usr/lib/perl5/Crypt/GPG.pm

      so while we are good with the perl path it doe look like the @INC on the web server doesnt have a path to my module

      and so i found out godaddy has a fix, i just had to add use cPanelUserConfig; in there to resolve the private libs.

      thanks!!!!

Re^3: cannot use Crypt::GPG for CGI
by FloydATC (Deacon) on Jun 15, 2016 at 07:04 UTC

    Maybe the module has been (incorrectly) installed local to the root user instead of system-wide? I installed a fresh CentOS 7 VM just a few days ago that seemed to have an SElinux problem that prevented CPAN from installing modules system-wide. That problem went away after setting SElinux to "permissive", which I had to do anyway because... reasons.

    One of the reasons being that I always find SElinux to be a royal pain in the STDOUT.

    -- FloydATC

    Time flies when you don't know what you're doing

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1165683]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-29 13:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found