LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   python cgi script and premature end of script headers (https://www.linuxquestions.org/questions/programming-9/python-cgi-script-and-premature-end-of-script-headers-347677/)

Neruocomp 07-28-2005 11:11 AM

python cgi script and premature end of script headers
 
I've been trying to get a python cgi script to work but keep getting a "Premature end of script headers" error from apache. Even with the most simple hello world script, I still get that error.

#!/usr/bin/python
print "Content-type: text/html\n"
print "<h1>Hello World!</h1>"

That is the script, and it is set to execute. I also have this in my httpd.conf

<Directory /home/*/public_html/cgi/>
Options ExecCGI
SetHandler cgi-script

AllowOverride None
Allow from all
Order allow,deny
</Directory>

I also found out that the error might be caused by how windows saves files, but I've been doing this all from linux and using kate. I've even used nano to write it and I still get the error. So I don't think its the end of line problem. I've got other things running on my server that use perl, and those scripts work just fine, so why is it that my python scripts don't want to work? Is it something in my httpd.conf file that is messing me up?

I'm running FC4 x86_64.

Neruocomp 07-28-2005 11:43 AM

Just to update, I looked at my suexec log and there doesn't seem to be any errors. This is what I get when the script tries to run.

[2005-07-28 11:30:12]: uid: (500/davidnoriega) gid: (500/500) cmd: test2.py
[2005-07-28 11:30:12]: directory is writable by others: (/home/davidnoriega/p ic_html/cgi)


All times are GMT -5. The time now is 03:19 AM.