Thursday 17th May 2012Login | Register
Pages: [1]

Error: "Premature end of script headers"

« on 16/03/2010, 18:43 »
Im getting the following error:

Premature end of script headers


followed by Error 500

When running some, not all of my perl scripts

Googling found this:
http://httpd.apache.org/d...#premature-script-headers

But this will mean more to you than me.

EDIT: I see this has been raised before, but I dont have a .htacess file
http://community.plus.net...ex.php/topic,84357.0.html

« Last Edit: 16/03/2010, 18:59 by UncleZen »

Logged
« Reply #1 on 16/03/2010, 22:02 »
My main site isn't working still, but I uploaded a test script just to get some confidence and that started off with getting the end of script error. A quick check of the permissions showed it was not executable, so I change the permissions to 700 (rwx------) and it then worked... just need to understand why my main app isn't showing any life....
Logged
« Reply #2 on 18/03/2010, 10:12 »
This may help others.
I was getting this error and I was relying on $ENV{C_DOCUMENT_ROOT} to get the path to my scripts (perl).
As $ENV{C_DOCUMENT_ROOT} no longer existed, I amended the path manually so it was correct.
Now I dont get the "Premature end of script headers" error. I assume that because my path was wrong I was trying to access a script in an area of the webserver I was not allowed, hence the error.
Logged
« Reply #3 on 18/03/2010, 10:48 »
Or you could add this near the top of your script:

Code:
($ENV{'C_DOCUMENT_ROOT'} = $ENV{'SCRIPT_FILENAME'}) =~ s/$ENV{'SCRIPT_URL'}/\//;

It'll be a bit more portable that way.
Ben Brown
Plusnet Infrastructure Engineer
Logged
Pages: [1]
Jump to:  

Related Sites

Community Apps

Here at Plusnet we're always trying to use clever open source things to make our lives easier. Sometimes we write our own and make other people's lives easier too!

View the Plusnet Open Source applications page

About Plusnet

We're a Yorkshire-based provider selling broadband and phone services to homes and businesses throughout the UK. Winner of the ISPA 2010 'Best Consumer Customer Service ISP' Award, we're proud to offer the UK's best value standalone broadband.

© Plusnet plc All Rights Reserved. E&OE

Powered by SMF | SMF © 2006-2008, Simple Machines LLC

Add to Technorati Favourites