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

/me tears hair. The shebang line was wrong. I have to get myself some colleagues... but at least I have sibling monks. Actually I only tear out half of my hair, because I think that even with a broken shebang line, it shouldn't give THAT error? Should it? Tell me I'm only half crazy?

§ George Sherston
  • Comment on Re: There isn't anything wrong with this, is there?

Replies are listed 'Best First'.
Re: Re: There isn't anything wrong with this, is there?
by virtualsue (Vicar) on Oct 12, 2001 at 14:06 UTC
    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. ;)
      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
Re: There isn't anything wrong with this, is there?
by cLive ;-) (Prior) on Oct 12, 2001 at 05:51 UTC
    "Actually I only tear out half of my hair"

    If you did, I hope it was in the shape of a circle on the top of your head - then you'd look like a monk ;-)

    cLive ;-)

Re: Re: There isn't anything wrong with this, is there?
by lestrrat (Deacon) on Oct 12, 2001 at 05:58 UTC

    I think the shbang problem would produce that error -- it was trying to open a non-existing program ( "some_dir/usr/bin/perl" ) to execute, and hence the error about fopen failing and not having permission ( no permission because the fopen failed )

    just guessing here, though...