PHP Warning: Cannot modify header information – headers already sent
It’s a common issue on the sites, PHP Warning: Cannot modify header information – headers already sent, Your site turn to a white page. You can see the error in the logs.
[01-Jan-2018 19:53:01 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/reporte21/public_html/wp-includes/functions.php:1) in /home/reporte21/public_html/wp-includes/functions.php on line 113
In order to solve the issue, it’s very easy. It’s occurred due to output_buffering is disabled in your PHP.
Step1. Login to the server via SSH/
Step2. You can see your sites PHP information by putting an info.php
Create an info.php under your domain’s document root
vim info.php
<?php phpinfo(); ?>
Save the file.
Step3. Set the permission for the info.php
Now call your domain.com/info.php you could see the PHP settings, then locate the domain’s php.ini location from the info.php
Eg: /opt/cpanel/ea-php56/root/etc/php.ini
It’s look like above mentioned location.
In that php.ini enable the output_buffering
output_buffering = 1
Save the php.ini.
Step4. Restart the httpd
service httpd restart
Now check the site after clearing your browser cache, It should okay now.