Cannot modify header information – headers already sent by …

If you receive a warning on your pages similar to the one below:

"Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/index.php:581) in /home/user/public_html/system/sessions.php on line 180"

there are a few things you can do in order to fix the issue:

1. You should check for any empty lines at the end of your .php files. This is a common issue with some web applications. Simply remove the empty line at the end of your script( after the final "?>" or "php>" string) and check your website again.

2. You can make a local php.ini file in the folder of your script and add the following line in it:

buffer_output = on

For more information on php.ini files, you can refer to this article.

3. If the warnings are not affecting the functionality of your website, you can simply hide them. Detailed instructions on how to do this can be found here.

You find this article useful? Click here to learn more about SiteGround web hosting experts and what else we can do for you!

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

My Facebook application is displaying ‘Method Not Allowed’

If you are encountering this problem with your Facebook application hosted on your SiteGround...

What to do if your website has been marked by Google as harmful

If you see the following warning when you visit your site: This site may harm your computer....

HTTP error codes explained

There are multiple HTTP codes that you may come across. Below you can find a summary of the most...

I’m getting a ‘MySQL server has gone away’ error in my application

There are two main reasons for this error message to show: 1) The MySQL query you are trying to...

Error: Sessions directory is not writable

By default, such an error is received when you use a custom php.ini file and the directive...