Running python cgi...

Status
Not open for further replies.

itsech0

New Member
Messages
1
Reaction score
0
Points
0
I've been trying to get this python script to work but no success. It's a simple hello world script and it keeps giving me a 500 error... I check the logs and the errors are not very useful. All it says is it can't find 500.shtml. No information about the reason the scripts aren't executing properly. I've uploaded this script to /cgi-bin/ as hello.cgi and chmoded to 777:

#!/usr/local/bin/python

print "Content-Type: text/plain\n\n"

import sys
print sys.version
print sys.modules

-----------------------

I even tried /usr/bin/python and that didn't work. Can anyone help me get this to work?
 

Dannz

New Member
Messages
43
Reaction score
0
Points
0
Have you set up the Apache handler in cPanel - you need to do this for Python to work ok. Usually best to keep the Python scripts with a .py extension and to set up this extension in the Apache handler.
 
Status
Not open for further replies.
Top