python

jimkirk

New member
cpanel username: worf359

http://jedd.info/cgi-bin/test.py


hey i was experimenting with python on my server and i successfully uploaded one file and everything worked fine and dandy and then i tried to upload a second and everything broke

now any .py files won't work, the file contents were:

Code:
#! /usr/bin/python

print "Content-type: text/html\n\n"
print "<html>Hello world!</html>"

and i uploaded them to the cgi-bin
 

un4saken

Administrator
According to logs

Code:
[Sat Dec 21 11:12:42 2013] [error] suexec policy violation: see suexec log for more details, referer: http://gigalicous.com/forum/thread-1112.html
[Sat Dec 21 11:12:42 2013] [error]  Premature end of script headers: test.py, referer: http://gigalicous.com/forum/thread-1112.html

First error means wrong file permissions, second error means there are hidden characters in your file.


http://stackoverflow.com/questions/10665830/basic-python-script-giving-internal-server-error
http://docs.python.org/2/howto/webservers.html
 

admin

Administrator
Staff member
Are you setting the file permissions correctly? Double check your scripts and their installation settings to make sure. I can asure that Python is working correctly.
 

jimkirk

New member
DJB said:
Are you setting the file permissions correctly? Double check your scripts and their installation settings to make sure. I can asure that Python is working correctly.

you betcha, it worked for one minute then i copied the exact file from my computer and uploaded it and it wasn't working, and there were no hidden characters (if what you mean is malicious code) in my files
 

un4saken

Administrator
jimkirk said:
DJB said:
Are you setting the file permissions correctly? Double check your scripts and their installation settings to make sure. I can asure that Python is working correctly.

you betcha, it worked for one minute then i copied the exact file from my computer and uploaded it and it wasn't working, and there were no hidden characters (if what you mean is malicious code) in my files

you need to replace windows linebreaks with unix ones. It seems you need to check the links i posted earlier.

edit: Your file permission is wrong as i said, just checked.
 

jaran

New member
Good news if someone opening new thread about Python coding. Because I want to learn about python too.