LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-28-2005, 11:11 AM   #1
Neruocomp
Member
 
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.

#!/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.
 
Old 07-28-2005, 11:43 AM   #2
Neruocomp
Member
 
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: test2.py
[2005-07-28 11:30:12]: directory is writable by others: (/home/davidnoriega/p ic_html/cgi)
 
  


Reply



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: countdown.pl" 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

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:39 AM.

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