in reply to Differences between CGI and command-line versions of scripts?!?

Apart from the environment variables that will be different, the biggest one is that CGI scripts typically run with the same permissions as the web server process, which are usually set to be quite restricted.

You could help yourself out a lot by printing out the error returned by the operating system instead of simply dying with "something went wrong" messages; open or die "Ack!@: $!\n" ought to give you some insight into whether this is a permissions problem.

HTH

Philosophy can be made out of anything. Or less -- Jerry A. Fodor

  • Comment on Re: Differences between CGI and command-line versions of scripts?!?
  • Download Code

Replies are listed 'Best First'.
Re: Re: Differences between CGI and command-line versions of scripts?!?
by jbwiv (Acolyte) on Apr 03, 2001 at 21:57 UTC

    Good point. I typically do provide more error output but for this post decided to be brief.

    My problem is...the script isn't dying. The script runs just fine. The only problem is when I try to qx() and pass off the java registration commands to Dos. When I run the full script from a command-line, it works just fine. But when I run it from CGI, I get errors returned from the Java registration command.

    That leaves me to believe that it's something to do with the environment the script is running in from the web server (in this case M$ PWS).

    thanks!
    jbwiv