Title: PHP error: Cannot modify header information
Last modified: January 21, 2025

---

# PHP error: Cannot modify header information

 *  [Dominique DC](https://wordpress.org/support/users/dominique_delcourt_com/)
 * (@dominique_delcourt_com)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/php-error-cannot-modify-header-information-2/)
 * Hi,
   I have the following PHP Error in the server logs which repeats itself so
   many times :[21-Jan-2025 06:56:45 UTC] PHP Warning: Cannot modify header information–
   headers already sent in …/wp-content/plugins/sg-cachepress/core/File_Cacher/Cache.
   php on line 145Which comes from this line of code :
 *     ```wp-block-code
           // Bail if the page is excluded from the cache.    if ( ! $this->is_cacheable() ) {        header( 'SG-F-Cache: BYPASS' );        return;    }
       ```
   
 * 
   I have tried to flush the buffer, but I get the same result :
 *     ```wp-block-code
           // Bail if the page is excluded from the cache.
           if ( ! $this->is_cacheable() ) {
               flush(); // Flush the buffer
               ob_flush();
   
               header( 'SG-F-Cache: BYPASS' );
               return;
           }
       ```
   
 * `Thanks for your help !Kind regards,Dominique
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fphp-error-cannot-modify-header-information-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [Svetoslav Vasev](https://wordpress.org/support/users/svetoslavvasev/)
 * (@svetoslavvasev)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/php-error-cannot-modify-header-information-2/#post-18255915)
 * Hello [@dominique_delcourt_com](https://wordpress.org/support/users/dominique_delcourt_com/),
 * The warning you’ve encountered – Cannot modify header information – can be suppressed
   in most cases by setting the value of the PHP variable output_buffering to 1.
 * If you are a SiteGround customer, please contact us by posting a ticket request
   and we will assist you further in case the warning persists after enabling the
   PHP output buffering.
 * Kind Regards,
 * Svetoslav Vasev
 *  Thread Starter [Dominique DC](https://wordpress.org/support/users/dominique_delcourt_com/)
 * (@dominique_delcourt_com)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/php-error-cannot-modify-header-information-2/#post-18261939)
 * Dear Svetoslav Vasev,
   It is for one of my clients… the website is not hosted 
   by SiteGround.I have tried with : **output_buffering = on**. but I get the exact
   same result.I had a very good speed page on my biggest article.. I would like
   to continue to use your plugin !Any other idea ? Kind regards,Dominique
 * 
   `[23-Jan-2025 18:10:01 UTC] PHP Warning: Cannot modify header information - 
   headers already sent in /srv/data/web/vhosts/phytopyo.alphanosos.com/htdocs/wp-
   content/plugins/sg-cachepress/core/File_Cacher/Cache.php on line 156 [23-Jan-
   2025 18:12:01 UTC] PHP Warning: Cannot modify header information - headers already
   sent in /srv/data/web/vhosts/phytopyo.alphanosos.com/htdocs/wp-content/plugins/
   sg-cachepress/core/File_Cacher/Cache.php on line 156 [23-Jan-2025 18:14:23 UTC]
   PHP Warning: Cannot modify header information - headers already sent in /srv/
   data/web/vhosts/phytopyo.alphanosos.com/htdocs/wp-content/plugins/sg-cachepress/
   core/File_Cacher/Cache.php on line 156 [23-Jan-2025 18:15:58 UTC] PHP Warning:
   Cannot modify header information - headers already sent in /srv/data/web/vhosts/
   phytopyo.alphanosos.com/htdocs/wp-content/plugins/sg-cachepress/core/File_Cacher/
   Cache.php on line 156 [23-Jan-2025 18:18:10 UTC] PHP Warning: Cannot modify header
   information - headers already sent in /srv/data/web/vhosts/phytopyo.alphanosos.
   com/htdocs/wp-content/plugins/sg-cachepress/core/File_Cacher/Cache.php on line
   156 [23-Jan-2025 18:18:44 UTC] PHP Warning: Cannot modify header information -
   headers already sent in /srv/data/web/vhosts/phytopyo.alphanosos.com/htdocs/wp-
   content/plugins/sg-cachepress/core/File_Cacher/Cache.php on line 156 [23-Jan-
   2025 18:20:57 UTC] PHP Warning: Cannot modify header information - headers already
   sent in /srv/data/web/vhosts/phytopyo.alphanosos.com/htdocs/wp-content/plugins/
   sg-cachepress/core/File_Cacher/Cache.php on line 156 [23-Jan-2025 18:22:56 UTC]
   PHP Warning: Cannot modify header information - headers already sent in /srv/
   data/web/vhosts/phytopyo.alphanosos.com/htdocs/wp-content/plugins/sg-cachepress/
   core/File_Cacher/Cache.php on line 156 [23-Jan-2025 18:24:56 UTC] PHP Warning:
   Cannot modify header information - headers already sent in /srv/data/web/vhosts/
   phytopyo.alphanosos.com/htdocs/wp-content/plugins/sg-cachepress/core/File_Cacher/
   Cache.php on line 156 [23-Jan-2025 18:26:56 UTC] PHP Warning: Cannot modify header
   information - headers already sent in /srv/data/web/vhosts/phytopyo.alphanosos.
   com/htdocs/wp-content/plugins/sg-cachepress/core/File_Cacher/Cache.php on line
   156[23-Jan-2025 18:32:03 UTC] PHP Warning: Cannot modify header information -
   headers already sent in /srv/data/web/vhosts/phytopyo.alphanosos.com/htdocs/wp-
   content/plugins/sg-cachepress/core/File_Cacher/Cache.php on line 156 [23-Jan-
   2025 18:32:21 UTC] PHP Warning: Cannot modify header information - headers already
   sent in /srv/data/web/vhosts/phytopyo.alphanosos.com/htdocs/wp-content/plugins/
   sg-cachepress/core/File_Cacher/Cache.php on line 156
 *  Plugin Support [Vladimir Trandev](https://wordpress.org/support/users/vtrandev/)
 * (@vtrandev)
 * [1 year, 2 months ago](https://wordpress.org/support/topic/php-error-cannot-modify-header-information-2/#post-18262223)
 * Hello [@dominique_delcourt_com](https://wordpress.org/support/users/dominique_delcourt_com/),
 * The PHP warning might be generated by another plugin’s script execution. Since
   we can not further check the case on our end, I would recommend you to disable
   all your plugins one by one in order to determine the exact plugin.
 * Have in mind that the mentioned warning is not a fatal PHP error and it can be
   safely disregarded.
 * Regards,
 * Vladimir

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘PHP error: Cannot modify header information’ is closed to new replies.

 * ![](https://ps.w.org/sg-cachepress/assets/icon-256x256.gif?rev=2971889)
 * [Speed Optimizer - The All-In-One Performance-Boosting Plugin](https://wordpress.org/plugins/sg-cachepress/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-cachepress/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-cachepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-cachepress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-cachepress/reviews/)

## Tags

 * [Cannot modify header information](https://wordpress.org/support/topic-tag/cannot-modify-header-information/)

 * 3 replies
 * 3 participants
 * Last reply from: [Vladimir Trandev](https://wordpress.org/support/users/vtrandev/)
 * Last activity: [1 year, 2 months ago](https://wordpress.org/support/topic/php-error-cannot-modify-header-information-2/#post-18262223)
 * Status: not resolved