Header --- already sent -- show errors

hey there,

i write my php scripts on my local network. when i upload my scripts to my webhost and run them i get header errors (already sent) when running those scripts , and none when running them on my computer.

is there an option to turn on ‘show these errors’ somewhere?

-chris

Use output buffering, or send the headers at the very start :slight_smile:

I think it’s got something to do with your php.ini, afaik there’s an option somewhere that sets up buffering…

hey there,

thanks for the reply, i turned output_buffering on, off, set it to different values, still no difference. anyone else have a solution?

chris

At the top of your file:

<?php
ob_start();

at the end of your file:

ob_end_flush();
?>

That will solve that. But what you are encountering is your are sending header data “after” the page has already been outputted. Header data like cookies, for instance.

hey,

k i’ll try that. i am purposely sending data first… i cannot get the error to display though.

-chris

Set this in your file:
error_reporting (E_ALL);

ok awesome its finally showing, thanks for the help everyone =)

chris