Possible Duplicate:
Headers already sent by PHP
I keep getting this error in my log files:
[15-Jan-2013 00:50:04] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/usr/public_html/display.php:1) in /home/usr/public_html/display.php on line 17
So I take a look at the page on the first line and I don't see anywhere that could have had headers being sent.
display.php:
<?PHP
require './err/errhandler.php';
require './assets/display.php';
require './assets/excrate.php';
$mysql_host = "sqlhost";
$mysql_database = "db";
$mysql_user = "user";
$mysql_password = "password";
$name = $_REQUEST["q"];
$type = $_GET["s"];
$timeperiod = $_POST["tp"];
$currency = $_POST["c"];
if(isset($currency)){
setcookie("prefCur", $currency, time()+60*60*24*30*12, "/");
$_COOKIE["prefCur"] = $currency;
} else {
if(!isset($_COOKIE["prefCur"])){
setcookie("prefCur", "usd", time()+60*60*24*30*12, "/");
$_COOKIE["prefCur"] = "usd";
}
}
...
errhandler.php:
<?PHP
ini_set('display_errors', false);
ini_set('log_errors', true);
ini_set('error_log', dirname(__FILE__) . '/_err.log');
ini_set('output_buffering', 'on');
display.php:
<?PHP
function strip_name($name)
{
return preg_replace('/\s\([a-zA-Z 0-9]*\)/', '', preg_replace('/[0-9%]+\s/', '', str_replace(":", "", str_replace("-H", "-h", $name))));
}
excrate.php:
<?PHP $eur = 0.747807; $gbp = 0.621828; $rub = 30.227148;
Then I wonder if it's my host that is appending a php file so change my htaccess into:
php_value auto_prepend_file none
php_value auto_append_file none
Options +FollowSymLinks
...
And I still get the error claiming that headers are already sent. I'm stumped right now. Where are headers being sent on the first line? I can't even enable output buffering because it's on the first line!
EDIT: There is absolutely NOTHING before the <?PHP
, even with output buffering on, it doesn't work. It just shifts down from line 17 to line 18.