in reply to premature end of script headers

The webserver failed to execute /var/www/cgi-bin/authenticate/search.cgi probably because the path to perl is wrong in the shebang line at the top of the script. "No such file or directory: exec of..." is pretty much showing you that the script was found, but it failed to invoke a known interpreter or compiler.


Dave

Replies are listed 'Best First'.
Re^2: premature end of script headers
by fadingjava (Acolyte) on Oct 23, 2004 at 15:18 UTC
    i checked the path again and it is  /usr/bin/perl . also, another script runs fine with the same path .

      Yes, the path to perl is /usr/bin/perl. But as someone else said, look at the first line of your script, where you tell the OS where to find perl! Let me line it up on a chart below:

      Path to Perl.....: /usr/bin/perl Your Shebang Line: #!/user/bin/perl What's wrong: ^ | | Get rid of that 'e' in the first line of your script.

      Thus, the path to perl is wrong in your shebang line. What you have in the shebang line of your script does not match where perl is located on your system. If it works executing it from the command line, it's probably because you're typing perl scriptname, so the shebang line's path to perl is circumvented.

      Note I keep using 'perl' instead of Perl, because we're talking about the path to perl, the executable program, not Perl, the broader language.


      Dave