Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-28-2005, 11:11 AM   #1
Registered: Oct 2004
Distribution: Slackware, CentOS
Posts: 135

Rep: Reputation: 15
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.

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

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.
Old 07-28-2005, 11:43 AM   #2
Registered: Oct 2004
Distribution: Slackware, CentOS
Posts: 135

Original Poster
Rep: Reputation: 15
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:
[2005-07-28 11:30:12]: directory is writable by others: (/home/davidnoriega/p ic_html/cgi)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Premature end of script headers: CGI fatturi Linux - Newbie 4 07-19-2007 04:55 PM
Premature end of script headers bhomass Debian 1 12-02-2005 05:31 PM
Premature end of script headers webhead Red Hat 5 09-22-2004 01:56 AM
Perl/CGI Problem "Premature Premature end of script headers:" newuser455 Linux - Software 2 07-18-2004 11:47 AM
Premature End of Script Headers (Error 500) bsdb3 Red Hat 5 05-06-2004 11:55 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:42 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration