Home » Centos/RHEL » php error headers already sent…../home/username/public_html/top.php

php error headers already sent…../home/username/public_html/top.php

Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at /home/username/public_html/file.php:14) in /home/username/public_html/top.php on line 4

This generally happens when you have an empty or white space at the start or the end of your php files, Please check your php files and remove any spaces at the start and the end of the document and the problem should go away.

Or
Try placing this at the top of your page:
<? ob_start(); ?>

Then at the bottom of the page place this line of code:

<? ob_flush(); ?>

About

I am founder and webmaster of www.linuxpcfix.com and working as a Sr. Linux Administrator (Expertise on Linux/Unix & Cloud Server) and have been in the industry from last 7 years.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*

Time limit is exhausted. Please reload the CAPTCHA.

Categorized Tag Cloud