Python Cgi 500 Server Error
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the python internal server error 500 workings and policies of this site About Us Learn more about Stack apache python cgi internal server error Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions
Python Cgi Script Internal Server Error
Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. Join
End Of Script Output Before Headers Python
them; it only takes a minute: Sign up Getting python to work, Internal Server Error up vote 6 down vote favorite 2 I'm trying to get Python scripts, called from a web browser, to work. I keep getting the error: 500 Internal Server Error When I check my error logs I see the message Premature end of script headers malformed header from script python The only documentation of this error online says that it can be the result of having improper line return characters in your script, but I wrote my test script right from the shell with pico. Also, when I run the file from the command line it executes just fine. " So far the only change I have made to apache is to add the .py to the "AddHandler cgi-script" line. Thanks! Thanks for the quick responses. Here is the latest version of the test code. I added a couple new lines before the output as suggested but still get the same error: #!/usr/local/bin/python print "Content-type: text/html\n" print "\n\n" print "" print "
" print "Hi there.
" print "" print "" Some other details: I am running Apache 1.3 and don't have mod_python. I set apache to recognize .py as mentioned above. I am running the script from the main public_html folder. An update. It doesn't seem to matter what I put in the shebang line. I tried all of thhere for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the
500 Python Gun
workings and policies of this site About Us Learn more about premature end of script headers Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions how to fix 500 internal server error Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 6.2 million programmers, just like you, helping each other. http://stackoverflow.com/questions/378811/getting-python-to-work-internal-server-error Join them; it only takes a minute: Sign up Internal server error with simple .cgi, what is wrong? up vote 2 down vote favorite I'm in internet programming, and we are doing .cgi, but for the life of me, I cannot get my .cgi script to run at all, I know other people have it working, but mine just http://stackoverflow.com/questions/9255428/internal-server-error-with-simple-cgi-what-is-wrong refuses to run. Any suggestions? #!/usr/bin/env python print "Content-type: text/html" print print "
Server 3, and I'm struggling to get past a 500 internal server error on a Python CGI script. The HTML file (not that it could really be this) -