deidyomega Posted September 5, 2012 Posted September 5, 2012 Try this: whatever.cgi #!/usr/bin/python print "Content-Type: text/html" print print "Hello World" Two things I noticed, you didn't give an extra space after Content-Type (either using \n, or print), and you don't really need charset=utf-8 The error log inside of cpanel tells you (kinda) why the page failed, always start there. If my solution doesn't work, copy and paste the last 10 or so lines from your error log so I see what's going on. 1
ernecatlm Posted September 28, 2012 Posted September 28, 2012 I'm stuck with the same problem. I created an account on "stevie", who is supposed to be able to run python. now i put a small .cgi file with 755 permissions into the cgi-bin folder (also 755) and used the code you guys posted above. unfortunately i'm getting an internal server error (500). am i missing something here? or does it take a while until everything works on a new account?
Krydos Posted September 28, 2012 Posted September 28, 2012 "stevie", who is supposed to be able to run python.Python is working fine on Stevie.or does it take a while until everything works on a new account?Python should work as soon as you can see your site in a browser. So generally 24 hours or less after your account is created. If you actually want some help with this you should post a link to your test file.
ernecatlm Posted September 28, 2012 Posted September 28, 2012 Ok, so this is my file "test5.cgi" in the cgi-bin folder. folder and file are at 755 chmd #!/usr/bin/python print "Content-Type: text/html" print print "Hello World" here's a link: http://erneca.heliohost.org/cgi-bin/test5.cgi
Krydos Posted September 28, 2012 Posted September 28, 2012 Ok, I fixed it for you. The only problem was that you were using dos line endings. Unix doesn't like Microsoft much sometimes.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now