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 Quote
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? Quote
Krydos Posted September 28, 2012 Posted September 28, 2012 On 9/28/2012 at 2:12 PM, ernecatlm said: "stevie", who is supposed to be able to run python.Python is working fine on Stevie. On 9/28/2012 at 2:12 PM, ernecatlm said: 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. Quote
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 Quote
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. Quote
ernecatlm Posted September 28, 2012 Posted September 28, 2012 crazy stuff, i did'nt know that. thx. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.