0

Hi guys I am trying to follow http://elvenware.com/charlie/development/web/Python/Xampp.html to set up python with xampp . I am running xammp usb lite 1.77

following the directions here and on Python & XAMPP on Windows: how to?,

I have created

#!F:/Python27/python

print "Content-type: text/html\n\n"
print "<html><head><title>Hello World from Python</title></head><body>Hello World from a Python CGI Script</body></html>

when I try to run it after placing it in the cgi-bin folder and running it like htp://localhost/cgi-bin/test.py I get:

Premature end of script headers: test.py

BTW an included htp://localhost/cgi-bin/cgi.cgi script works!!

Any idea what I can do to fix this?

Thank you in advance,

Bill

1
  • +1 to @sotapme. You should write this up as an answer. Notice that if you run this same script on the command line, it will raise a SyntaxError: EOL while scanning string literal without even executing the first print statement. Which means no headers get printed out, which means you will get this error from xampp. Commented Jan 31, 2013 at 19:48

2 Answers 2

4

There is no ending " on line 2 - unless it's a mistake in copy/pasting

Sign up to request clarification or add additional context in comments.

1 Comment

You fixed it. Sorry, I'm new to python - Bill
0

I had the same problem with xampp.

The problem is in the httpd.conf. With xampp apache will be installed with another httpd.conf like the standalone install of apache.

Check your settings in the httpd.conf and change it.

1 Comment

It would help to provide the full paths of the multiple httpd.conf files as well as what setting you believe is wrong within the problematic file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.