Page 1 of 1

Premature end of script headers: index.php

Posted: Mon Apr 08, 2013 4:43 pm
by simonmlewis
What is this?
I'm being told this is one thing causing our site to run slow or crash.

It would really help if it gave me a line number in that file.
At the very top we have

Code: Select all

<?php session_start(); 
?>
And use to have a

Code: Select all

if(isset($_REQUEST['itemtype']))
{
    $itemtype = $_REQUEST['itemtype'];
    $_SESSION['itemtype']=$itemtype;
} else { $itemtype=$_SESSION['itemtype'];
}
if ($itemtype == NULL) { $itemtype = "Shirts";}
if(isset($_REQUEST['sort']))
{
    $sort = $_REQUEST['sort'];
    $_SESSION['sort']=$sort;
} else { $sort=$_SESSION['sort'];
}

if($sort == NULL) { $sort=title; }
This script would only be used by Administrators tho, which doesn't explain why it's happening via a referred product page. But could it be that it's calling this countless times, with no reason?

Also, what is this:

Code: Select all

[Sat Mar 16 17:45:10 2013] [error] [client 2.218.254.138] File does not exist: /home/site/public_html/facebox, referer:
The referring is one of our web pages, and yes it does use facebox for some popups. But it works - so why does something not exist? The folder certainly does.

And finally, we are seeing this too:

Code: Select all

[Sat Mar 16 17:58:47 2013] [error] [client 86.151.101.59] File does not exist: /home/site/public_html/graphics, referer:
There is nowhere in my code that states '/graphics'. So why is it something looking for it. I guarantee you my code doesn't look for it.

Re: Premature end of script headers: index.php

Posted: Tue Apr 09, 2013 6:01 pm
by Jade
What error are you getting? You mention it but you haven't posted it anywhere. If there's a space or any kind of text output before your session_start() that can cause the page to not load properly. Also make sure you have error reporting turned on in your php_ini file.

The things you posted from your log file are a client's or bot's attempt to load an incorrect url -- it has nothing to do with the page not loading correctly.