Python on Apache: Internal Server Error
Question: I'm getting `Internal Server Error` from my Python script on Apache.

The script has `chmod 755` and is in a directory different from `cgi-bin`.

Its content is

    
    
    #!/usr/bin/python
    print "Content-Type: text/html\n"
    print "test"
    

I'm on shared hosting with limited options. In particular I cannot view the
Apache logfile.


Answer: Apache tries to execute the script, but fails to do so because it is missing
`Options +ExecCGI` in the `.htaccess` located in the script's directory.

It is important to begin the script with the two lines

    
    
    #!/usr/bin/python
    print "Content-Type: text/html\n"
    

Without those, or without a trailing `\n`, Apache would throw an `Internal
Server Error`, too.

