Python Cgi 500 Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About python internal server error 500 Us Learn more about Stack Overflow the company Business Learn more about hiring apache python cgi internal server error developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the
Python 500 Error
Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up internal server error (500) in simple
End Of Script Output Before Headers Python
cgi script up vote 7 down vote favorite 1 I am trying to run a simple cgi script after configuring my server. My script looks like this: print "Content-type: text/html" print print "
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more
500 Python Gun
about Stack Overflow the company Business Learn more about hiring developers or posting premature end of script headers ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack how to fix 500 internal server error Overflow is a community of 6.2 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Python CGI throwing 500 Internal Server Error up vote 1 down http://stackoverflow.com/questions/1464728/internal-server-error-500-in-simple-cgi-script vote favorite Im running a website hosted on HelioHost, I'm a 10th grade student, so I can't exactly afford to pay for hosting. I was trying to run a simple CGI Script written in python on the web server: #!/usr/bin/env python print "Content-type: text/html\n\n" print "
Hello World
" Unfortunately, I got a 500 Internal Server error at http://fpl.heliohost.org/cgi-bin/lel.py I tried replacing the shebang line with #!/usr/bin/python, as suggested at http://www.heliohost.org/home/features/languages/python, http://stackoverflow.com/questions/27340286/python-cgi-throwing-500-internal-server-error but I'm still facing the same error. chmod is 755. Also, I'm able to run this on my PC via Python Command Line, and it works fine on my Apache Web Server on my Raspberry Pi. Any idea what could be causing the problem? python apache cgi host share|improve this question asked Dec 7 '14 at 6:30 poiasd 649 Check what your web server's error log says. Use the time of the request to line up with the relevant error log entry. –Alex Reynolds Dec 7 '14 at 6:34 Unfortunately HelioHost wont let me see the error log :( But I got it working! cgi-bin chmod was 777, I changed it to 755 and it started! But I wonder why it wouldn't work with extra permissions... –poiasd Dec 7 '14 at 6:42 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote I managed to get it working by changing the permissions (chmod) of cgi-bin to 0755 from 0777. The curious part is, why wasn't it working with 0777? I guess that's for another day...... share|improve this answer answered Dec 7 '14 at 6:43 poiasd 649 add a comment| Your Answer draft saved draft discarded SigError500 with a python script! Pages (2): 1 2 Next » Threaded Mode | Linear Mode Error500 with a python script! 05-06-2008, 03:28 AM Post: #1 https://discussion.dreamhost.com/thread-106122.html Mitheor Dreamling Posts: 1 Joined: May 2008 Error500 with a python script! Hi, http://vlexoforums.com/topic/11181-simple-python-script-gives-http500-internal-server-error/ i was trying to use a python script but it always returns an 500 internal server error. The script is very simple. I have tried to use the example of the the dreamhost wiki but it doesnt work either. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" #!/usr/bin/python def main(): print "Content-type: text/html" print print "
" print "Up All Content All Content This Topic This Forum Advanced Search Browse Forums Chat Staff Online Users More Activity All Activity My Activity Streams Unread Content Content I Started Search More More More All Activity Home VlexoFree Hosting VlexoFree Support Resolved Simple Python Script Gives HTTP500 Internal Server Error Sign in to follow this Followers 0 Simple Python Script Gives HTTP500 Internal Server Error Started by mishmash, January 21, 2012 python cgi 500 9 posts in this topic mishmash 0 Newbie Members 0 9 posts Posted January 21, 2012 (edited) · Report post Hello I have a simple python script I am trying to execute but when I access the file I get a HTTP500 error. Do I have the wrong Python Shebang? - The python file has the permissions: 7,5,5 - Following VlexoFrees advice I have looked at my .htaccess file & its empty so it cant be misconfigured(although maybe I need to configure it for python scripts?) - I have looked at the CPanel error logs but the 500 error isn't documented, it does show/record errors if I try to access the cgi-bin dir, ie, I go to www.selectrecipes.tk/cgi-bin/ - The python file should simply print out: "test" The file is here: http://www.selectrec...cgi-bin/test.py The contents of the file are simply: #!/usr/bin/python2.7 print "content-type: text/html \n\n" print "test" Edited January 21, 2012 by mishmash Share this post Link to post Share on other sites Eli L 132 VlexoFree Owner Owner 132 9,096 posts LocationWashington, USA Posted January 22, 2012 · Report post The path is /usr/bin/python [/CODE] Click your test link again and it works. Share this post Link to post Share on other sites mishmash 0 Newbie Members 0 9 posts Posted January 22, 2012 (edited) · Report post Thanks lol I like your debugging message Edited January 22, 2012 by mishmash Share this post Link to post Share on other sites mishmash 0 Newbie Members 0 9 posts Posted January 23, 2012 (edited) · Report post I am now unable to access/run th