Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

CGI program failed to work

by chaski (Initiate)
on Jan 27, 2003 at 20:02 UTC ( [id://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
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2024-04-25 19:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found