# Header --- already sent -- show errors

**URL:** <https://forum.kirupa.com/t/header-already-sent-show-errors/63721>\
**Category:** Uncategorized\
**Created:** [September 9, 2004, 1:43pm UTC](https://forum.kirupa.com/t/header-already-sent-show-errors/63721 "2004-09-09T13:43:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmd](https://avatars.discourse-cdn.com/v4/letter/c/dbc845/32.png) [@cmd](https://forum.kirupa.com/u/cmd)\
**Post date:** [September 9, 2004, 1:43pm UTC](https://forum.kirupa.com/t/header-already-sent-show-errors/63721/1 "2004-09-09T13:43:10Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 3:27pm UTC](https://forum.kirupa.com/t/header-already-sent-show-errors/63721/2 "2004-09-09T15:27:25Z")

</div>

Use output buffering, or send the headers at the very start 🙂

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 4:11pm UTC](https://forum.kirupa.com/t/header-already-sent-show-errors/63721/3 "2004-09-09T16:11:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 4:38pm UTC](https://forum.kirupa.com/t/header-already-sent-show-errors/63721/4 "2004-09-09T16:38:59Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 5:07pm UTC](https://forum.kirupa.com/t/header-already-sent-show-errors/63721/5 "2004-09-09T17:07:43Z")

</div>

> [@Marble](#):
>
> 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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 5:09pm UTC](https://forum.kirupa.com/t/header-already-sent-show-errors/63721/6 "2004-09-09T17:09:15Z")

</div>

Set this in your file:  
error\_reporting (E\_ALL);

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [September 9, 2004, 8:28pm UTC](https://forum.kirupa.com/t/header-already-sent-show-errors/63721/7 "2004-09-09T20:28:30Z")

</div>

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

chris
