Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

CGI program failed to work

by chaski (Initiate)
on Jan 27, 2003 at 20:02 UTC ( #230335=perlquestion: print w/replies, xml ) Need Help??
chaski has asked for the wisdom of the Perl Monks concerning the following question:

I had a CGI program working OK. Now I only can run it from the shell prompt. If I run It from a browser the Apache error log says :
Can't locate DynaLoader.pm in @INC (@INC contains: /usr/local/lib/perl +5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6 .1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/pe +rl5/site_perl/5.6.1 /usr/local/lib/perl5/site _perl) at /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/DBI.pm lin +e 125. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5. +6.1/sun4-solaris/DBI.pm line 125. Compilation failed in require at ./pruebacons line 10. BEGIN failed--compilation aborted at ./pruebacons line 10.
Can anybody help me?

Replies are listed 'Best First'.
Re: URGENT : CGI program failed to work
by Ovid (Cardinal) on Jan 27, 2003 at 20:40 UTC

    If you can run it from the command line, have you consired switching to the user that Apache is running under? If that fails, it may very well be some sort of permissions problem. Also, check to see if you have more than one version of Perl on the box and if you are running the same version of Perl from the command line as from the CGI program. I've been bitten by the latter.

    Cheers,
    Ovid

    New address of my CGI Course.
    Silence is Evil (feel free to copy and distribute widely - note copyright text)

      Just read your silence is evil text. Just wanted to say good text, and thanx.

        Merci. Regrettably, demerphq pointed out a flaw in my comments vis-a-vis evolution. I can still rewrite it to take into account his comments, but that's Yet Another Project which I haven't gotten around to working on.

        Cheers,
        Ovid

        New address of my CGI Course.
        Silence is Evil (feel free to copy and distribute widely - note copyright text)

Re: URGENT : CGI program failed to work
by thatguy (Parson) on Jan 27, 2003 at 20:27 UTC
Re: URGENT : CGI program failed to work
by ibanix (Hermit) on Jan 27, 2003 at 22:38 UTC
    Hi chaski,

    Can you please post your code? This helps everyone.

    Oh, and I should say, it might be URGENT to you, but it's not to the rest of us. :-)

    ibanix

    $ echo '$0 & $0 &' > foo; chmod a+x foo; foo;
      Or to put it differently (and, IMHO, better): everyone's problem is as urgent as anyone else's.

      Makeshifts last the longest.

        "Or to put it differently (and, IMHO, better): everyone's problem is as urgent as anyone else's."

        Mine isn't.

        But then again I have an inferiority complex (it's not a very good one).

Re: CGI program failed to work
by Cabrion (Friar) on Jan 28, 2003 at 02:26 UTC
    Your shebang line says something like #!/usr/bin/perl but on the command line you say
    perl some.cgi
    and it works that way right?

    If this is the case, your shebang line needs to be changed to point to the same version of perl that you are calling on the command line. Type this on the command line to get a hint.

    locate perl
    Good luck.
      I am on solaris using csh.. There is no LOCATE command available... Anyway.. even if you use : perl script.cgi or just script.cgi it works... thanks
Re: URGENT : CGI program failed to work
by silent11 (Vicar) on Jan 27, 2003 at 20:14 UTC
    Put this at the beginning of your script:
    set FLUX_CAPACITOR = 1;


    -Silent11
      Can't locate object method "set" via package "FLUX_CAPACITOR" (perhaps you forgot to load "FLUX_CAPACITOR"?)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2018-06-19 03:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?



    Results (111 votes). Check out past polls.

    Notices?