Matrix_Square Posted March 30, 2009 Posted March 30, 2009 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!
Byron Posted March 30, 2009 Posted March 30, 2009 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
Gnus Posted August 14, 2009 Posted August 14, 2009 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.
Byron Posted August 14, 2009 Posted August 14, 2009 Like I said in my previous post, I don't know anything about python but I was able to get this script to work a few months back by using a cgi extension. http://byrondallas.heliohost.org/cgi-bin/snakecharmer.cgi Maybe you can find an answer from a heliohost forum search? http://www.helionet.org/index/index.php?ac...highlite=python
Ashoat Posted August 14, 2009 Posted August 14, 2009 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?
Karak Posted November 25, 2009 Posted November 25, 2009 I try to use python without success It always give me 500 internal error. This is test script: http://karak.heliohost.org/cgi-bin/test.cgi It is just: #!/usr/bin/python print "Content-Type: text/plain;charset=utf-8" print "Hello World" What I have to do for it to work??
Karak Posted November 25, 2009 Posted November 25, 2009 When following above advice I only got .py files to show up as text files as someone mentioned before:( Please help.
il Catania Posted November 25, 2009 Posted November 25, 2009 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.
rogus Posted November 26, 2009 Posted November 26, 2009 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...
Jeroen Posted January 9, 2010 Posted January 9, 2010 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?
Byron Posted January 9, 2010 Posted January 9, 2010 @Byron: What's the source of that snakecharmer.py? and what did you do to make ik work? I had to run it with a .cgi extension or it would show up as text. I also have the addhander directive in my htaccess. http://byrondallas.heliohost.org/cgi-bin/snakecharmer.cgi http://byrondallas.heliohost.org/cgi-bin/snakecharmer.py source http://byrondallas.heliohost.org/temp/snakecharmer.txt
Karak Posted January 14, 2010 Posted January 14, 2010 Hello, I copy-pasted your snakecharmer code and even with cgi extension it doesn't work in my account. I can only use python using wsgi extension, but that is slightly different beast to deal with. Can you point me why it always throw 500 internal server error on my account? Link http://karak.heliohost.org/cgi-bin/snakecharmer.cgi
Byron Posted January 14, 2010 Posted January 14, 2010 Can you point me why it always throw 500 internal server error on my account? Link http://karak.heliohost.org/cgi-bin/snakecharmer.cgi I think you'd be better off uploading this text file and then renaming it with a cgi extension instead of copy and pasting. http://byrondallas.heliohost.org/temp/snakecharmer.txt Make sure your file permissions are 755.
benetta Posted January 31, 2010 Posted January 31, 2010 I am getting 500 internal server error for my .py/.cgi file. Did anyone find solution for 500 error?
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