Jump to content

Recommended Posts

Posted

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.

  • Like 1
  • 3 weeks later...
  • 2 weeks later...
Posted

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?

Posted

"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.

Posted

Ok, I fixed it for you. The only problem was that you were using dos line endings. -_- Unix doesn't like Microsoft much sometimes.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...