5

Cannot modify header information

 3 years ago
source link: https://help.dreamhost.com/hc/en-us/articles/214200768-Cannot-modify-header-information
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Cannot modify header information

Overview

You may notice the following error either when visiting your site or logging in to it:

Warning: Cannot modify header information - headers already sent by (output started at...'''

This is essentially an issue with how the site is coded. Most often, this simply means something was sent to the browser before the PHP header() function was called. Technically speaking, once the header block has already been sent, you cannot add additional header lines.

Fixing the error within the PHP code (advanced)

Most often this is caused by your code sending output to the browser before the header() function. Make sure your header() function is set in your code before any output. This would require a developer to edit the existing code of your site.

Fixing the error with a phprc file (easy)

If you do not want to make any adjustments to your code, you can create a phprc file and a few lines to it that will resolve this.

View the following articles for instructions on how to create a phprc file.

If the file already exists, view the following articles for instructions on how to update it (depending on if you're using an FTP client or SSH):

Once created, add the following lines to the phprc file:

output_buffering = 4096

See also

Did this article answer your questions?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK