• Dominique DC

    (@dominique_delcourt_com)


    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 145

    Which comes from this line of 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 :

        // 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 to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Svetoslav Vasev

    (@svetoslavvasev)

    Hello @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

    (@dominique_delcourt_com)

    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

    (@vtrandev)

    Hello @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)
  • You must be logged in to reply to this topic.