Python as serverside

I tried running a Python file on my server, and failed.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I wrote the file using the command line and it’s chmod’d to 755…

I’m not a Python programmer, but my bets are you’ve got a typo of some sort in your .htaccess file.

no .htaccess file is uploaded on

What does your error log say? (~/logs/

If you want useful replies, ask smart questions.

Ah. Does Apache module and/or CGI handle python by default? (…and are you running as CGI?) If not, you may wanna try putting an .htaccess file in the directory and adding something like:AddHandler python-program .py PythonHandler mpt PythonDebug On…to its contents. And again, I’ve never used Python, so this suggestion might be completely useless.

Have you double checked your shebang! line to make sure you are calling the correct instance/version of python for your script? DH as several versions (last time I checked) installed.


the python file I’m executing has no line indicating it’s a python file, such as <??> for php, I think that may be the problem.