I am trying to host a sample program test.py in my sourceforge repository. I uploaded my file from the directory /home/project-web/motiur/cgi-bin/
and then went to motiur.sourceforge.net/cgi-bin/test.py
. Unfortunately I got an error that suggests premature end of headers .
The source code of test.py :
#!/usr/local/bin/python
import cgi, cgitb
print "Content-type:text/html\n"
print "<html><body>This is another test</body></html>"
The exact error is:
An error has been encountered in accessing this page.
1. Server: motiur.sourceforge.net
2. URL path: /cgi-bin/test.py
3. Error notes: Premature end of script headers: test.py
4. Error type: 500
5. Request method: GET
6. Request query string:
7. Time: 2013-01-12 14:49:39 UTC (1358002179)
BTW, I am using filezilla in windows and had set the file permission to 755, that is everybody can execute the file. This a noob question, a little help will be much appreciated. Thanks.
print "Content-type:text/html\n\n"
.#!/usr/bin/env python
at the beginning?