Jump to content

Recommended Posts

Posted

Hi gang,

 

I can't believe I still can't get Python to work. I followed the instruction pretty darn clearly (after all, how hard can it be to add a Shebang line and plunk the file into the cgi-bin folder?!), yet the server keeps on me a Internal Server Error (500) as follows:

Internal Server Error

 

The server encountered an internal error or misconfiguration and was unable to complete your request.

 

Please contact the server administrator, webmaster@mse.heliohost.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

 

More information about this error may be available in the server error log.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

My file is simply called processing.py and it "should" be accessible by using www.mse.heliohost.org/cgi-bin/processing.py, but it's not.

 

Any ideas? Or did I set something up incorrectly? Do I have to fiddle around with the .htaccess file to give access to anything in particular? Or anything I might have missed? Etc.

 

I'm at my wit's end, help!

Posted

I never use Python but I just tried a simple Hello World and got a 500 Error and that was with a .py and a .cgi extension. So Python must not be working on the server.

 

#!/usr/bin/python
print "Content-Type: text/html\n\n"
print "Hello World"

 

btw, you can make all directories execute cgi with .htaccess and I'm guessing it does the same thing with Python.

 

EDIT:

 

Try adding the python handler to your .htaccess file:

 

AddHandler python-program .py

 

or use the Apache Handler option from your cpanel to add it:

 

python-program .py

 

 

 

  • 4 months later...
Posted

Has anyone got Python work?

I added shebang, copied to cgi-bin, fixed file permission to 755 and added apache handler "AddHandler python-program .py" but the best I achieved was showing the source as a plain text.

Posted

My "snakecharmer.py" file is working fine. I'll investigate this a little and get back to you guys.

 

UPDATE

Well, I copied the snakecharmer file to a test account. It gave me a 500, but I refreshed three times and then it started to work. Is anybody's Python script working now, or after a couple of refreshes?

  • 3 months later...
Posted

I don't know if this may be of any interest to you, but I managed to run a django-based website on heliohost last week (still running).

I followed the django tutorial with some adjustements.

Posted

the problem seems to be somewhere in between server and database...

I get the error (500) once I try to connect to database (put any info regarding it in settings.py)

 

This eventually means Django cannot be used for any database apps.

Hope this issue will be investigated - can try and help but my knowledge in terms of (server configuration, wsgi) is very rudimentary...

  • 1 month later...
Posted

My python file is also showing up as text as you can see:

 

http://zjeroen.heliohost.org/script1.py

http://www.zjeroen.heliohost.org/cgi-bin/script1.py

 

I've set the permissions to 0755 and added the line

AddHandler python-program .py

to my .htaccess. It's showing up in the Apache Handlers in cpanel.

 

My source is:

 

#!/usr/bin/python

print "Content-Type: text/html"     
print                               

print "Alive"

 

 

@Byron: What's the source of that snakecharmer.py? and what did you do to make ik work?

  • 3 weeks later...

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