in reply to Re: There isn't anything wrong with this, is there?
in thread There isn't anything wrong with this, is there?

I take it you are developing on win32. On Unix, which is probably your ISP's platform OS, a bungled shebang will definitely result in a fatal error. The shebang line tells the shell to run the text following using the program named in it. If that path is broken, your script is broken.

Update:

The result of running the script is "Premature end of script headers". This is the error that webservers typically return whenever a CGI script dies before it can output valid HTML headers, which is exactly what is happening in this case. You have already done this, so you know, but for anyone else reading this who might have a similar problem, the next step is to run the script on the command line *on the same platform*. Then you'll see another slightly cryptic message such as "ksh: {scriptname}: not found". Typos in shebangs trip up everyone from time to time. ;)
  • Comment on Re: Re: There isn't anything wrong with this, is there?

Replies are listed 'Best First'.
Re: Re: Re: There isn't anything wrong with this, is there?
by George_Sherston (Vicar) on Oct 12, 2001 at 14:14 UTC
    Right on both counts. My question, though, is whether I would expect to get the mystery log file error as a result of a broken shebang line. It doesn't make sense to this bear of little brain. I would have expected something like interpreter not found or no such file... not
    fopen: Permission denied failed to open log file
    which is what I actually get. But it's perfectly possible I'm mistaken as this is definitely not my area of expertise. If anyone can tell me, I'd be very grateful.

    § George Sherston
      since your script isn't writing to a file, it must be the webserver trying to log the action and failing due to permissions.. I would have your ISP check the permissions on their access_log or non-error_log logs.
      -p