Thursday, April 30, 2015

It's not always what it seems

Recently I was moving Python CGI code to an Apache server and received the following error messages.

          suexec failure: could not open log file
          fopen: Permission denied
          Premature end of script headers: mc.cgi

I checked and double checked permissions, links, names for embedded spaces and more.  Googling suggested a few more things like inappropriate EOL constructs.  No Joy.

In the end I discovered a fix that had nothing to do with permissions or a log file.  ...nor was there any such suggestion from the search engines.  My problem was an incorrect shebang (#!) for the CGI script.  After fixing that all was well.