500 Internal Server Error Python Cgi
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the premature end of script headers cgi python workings and policies of this site About Us Learn more about Stack
Apache Cgi 500 Internal Server Error
Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs cgi bin 500 internal server error Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join internal server error cgi python them; it only takes a minute: Sign up internal server error (500) in simple 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 "
Apache Python Cgi Internal Server Error
my scripts url http://127.0.0.1/~flybywire/cgi-bin/main.py I get: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. And in error.log I get the following: [error] (8)Exec format error: exec of '/home/flybywire/www/cgi-bin/main.py' failed [error] [client 127.0.0.1] Premature end of script headers: main.py Other info: Apache/2.2.8 (Ubuntu) DAV/2 SVN/1.4.6 Server at 127.0.0.1 Port 80 python apache cgi share|improve this question asked Sep 23 '09 at 8:33 flybywire 64.2k145334456 add a comment| 5 Answers 5 active oldest votes up vote 18 down vote accepted You might need a #!/usr/bin/python at the top of your script to tell Apache to use Python to execute it. At least, I did that and it worked for me :-) . share|improve this answer answered Sep 23 '09 at 8:44 Paul Stephenson 31k73545 thank you, it works. –flybywire Sep 23 '09 at 8:45 I think add #!/usr/bin/python to all cgi script is scary. How to set it by apache SetEnv PYTHONPATH? –gonjay Mar 10 '15 at 9:21 add a comment| up vote
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the end of script output before headers python workings and policies of this site About Us Learn more about Stack python 500 alarm Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs
Premature End Of Script Headers
Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join http://stackoverflow.com/questions/1464728/internal-server-error-500-in-simple-cgi-script them; it only takes a minute: Sign up Python CGI getting 500 Internal Server Error up vote 0 down vote favorite I'm making first python script. I've uploaded the script in public_html/cgi-bin folder with 777 permission. I'm getting this 500 Internal server error. I've wrote the following code. #!/usr/bin/python print "Content-type: text/html\r\n" print "
Server 3, and I'm struggling to get past a 500 internal server error on a Python http://www.frihost.com/forums/vt-96965.html CGI script. The HTML file (not that it could really be this) -