LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-25-2009, 11:57 PM   #1
yuri16
Member
 
Registered: Jan 2009
Location: Philippines
Posts: 59

Rep: Reputation: 15
Question Premature End of Script Headers


Hi,

I got errors while testing a web portal. Here's the content in error.log:

IOError: [Errno 2] No such file or directory: '/var/www/data/programs/index/inputs.dat'
[Tue May 26 10:17:28 2009] [error] [client 202.90.157.248] Premature end of script headers: datatypes_list.py, referer: http://localhost/cgi-bin/portal.py


How can I solved the 2nd error regarding premature end of script headers? What do I need to edit? the portal.py or the httpd.conf of apache? And what part of them I am looking for? sorry I'm new to this.

Thanks for any help.
 
Old 05-26-2009, 01:39 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,598

Rep: Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531
"Premature end of script headers" means that the output produced by the program in question is not valid HTML. To test if that's the case run the python program from CLI and see if you get any HTML code.
Maybe the 2nd error is because of the 1st (file not found), which as the name implies is used for input.
So I guess you have to review the configuration of the software you're trying to install.

Regards
 
Old 05-26-2009, 02:35 AM   #3
yuri16
Member
 
Registered: Jan 2009
Location: Philippines
Posts: 59

Original Poster
Rep: Reputation: 15
Can you tell me if there's anything wrong in this script:

#!/usr/bin/python2.5

from Mobyle.DataInputsIndex import *
from Mobyle.Classes.DataType import DataTypeFactory

class DatatypesList(mb_cgi.JSONCGI):
"""
Datatype information

@author: Herve Menager
@organization: Institut Pasteur
@contact:mobyle@pasteur.fr
"""
def process( self ):
dataInputs = DataInputsIndex()
datatypes = {}
df = DataTypeFactory()
for key, parameter in dataInputs.getList().items():
if not(datatypes.has_key(parameter.get('dataTypeClass'))):
datatypes[parameter.get('dataTypeClass')]={}
if parameter.get('dataTypeSuperClass'):
dt = df.newDataType(parameter.get('dataTypeSuperClass'),parameter.get('dataTypeClass'))
else:
dt = df.newDataType(parameter.get('dataTypeClass'))
datatypes[parameter.get('dataTypeClass')]['ancestorTypes']=dt.ancestors
self.jsonMap = datatypes

if __name__ == "__main__":
il = DatatypesList()
il.process()
il.render()



Thanks.
 
Old 05-26-2009, 04:03 AM   #4
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 11,598

Rep: Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531Reputation: 1531
I know nothing about python, but as I told you can run the program that produces this error and see if produces valid HTML code
Code:
python /path/to/datatypes_list.py
When I run the above code, it complains about an IndentationError.

Also make sure that all your python programs you want apache to run are executable

Last edited by bathory; 05-26-2009 at 04:06 AM.
 
  


Reply


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 05:55 PM
Premature end of script headers bhomass Debian 1 12-02-2005 06:31 PM
Premature end of script headers webhead Red Hat 5 09-22-2004 02:56 AM
Perl/CGI Problem "Premature Premature end of script headers: countdown.pl" newuser455 Linux - Software 2 07-18-2004 12:47 PM
Premature End of Script Headers (Error 500) bsdb3 Red Hat 5 05-06-2004 12:55 PM


All times are GMT -5. The time now is 04:56 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration