Overview
This article offers different options to resolve the common "Cannot modify header information" PHP error.
Background
You may notice the following error either on your PHP website:
Warning: Cannot modify header information - headers already sent by (output started at...'''
This is essentially an issue with how the site is coded. It states that something was sent to the browser before the PHP header() function was called, and once the header block has already been sent, you cannot add additional header lines.
How to fix this error
There are two ways you can resolve this error.
Using a phprc file (easy)
You can create/edit your user's phprc file and add a few lines to resolve this. See 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
Editing the PHP code (advanced)
This error is most often caused by your code sending output to the browser before the header() function. To resolve this, you (or a developer) would need to manually edit the website's code so the header() function is set before any output.