• Resolved rl347

    (@rl347)


    Am in the ‘Headers Sent’ Hell!

    On redirect my code shows that headers were previously sent from headers.php line xx. More to the point when I cut a new page including the following text
    <?php print_r(headers_list(); headers_sent ($file ,$line);echo $file ,$line; ?>
    , it shows that headers were sent from headers.php same line.

    I have:
    – checked for errant spaces/stuff in headers.php, wp-config and of course my code.
    – used alternative theme
    – reinstalled suffusion
    – disabled all plugins, bar exec php
    – done a wp4.1 upgrade
    All to no avail. Worse on another similar site, headers_sent shows false. I have compared wp settings and, apart from there being no ‘default link category’ on write page, they are identical.

    I have done a trackback on the headers.php function call (below) and in my ignorance I don’t know whether that shows a normal course of events, or whether it points to a source of the problem

    Please could someone rescue me from my stupidity?

    Ron

    demo page here: https://northdevoncamra.org.uk/edits/
    trackback:

    Array
    (
        [0] => Array
            (
                [file] => /home/northdev/public_html/wp-includes/template.php
                [line] => 501
                [function] => require_once
            )
    
        [1] => Array
            (
                [file] => /home/northdev/public_html/wp-includes/template.php
                [line] => 477
                [function] => load_template
                [args] => Array
                    (
                        [0] => /home/northdev/public_html/wp-content/themes/suffusion/header.php
                        [1] => 1
                    )
    
            )
    
        [2] => Array
            (
                [file] => /home/northdev/public_html/wp-includes/general-template.php
                [line] => 45
                [function] => locate_template
                [args] => Array
                    (
                        [0] => Array
                            (
                                [0] => header.php
                            )
    
                        [1] => 1
                    )
    
            )
    
        [3] => Array
            (
                [file] => /home/northdev/public_html/wp-content/themes/suffusion_camra/no-sidebars.php
                [line] => 9
                [function] => get_header
                [args] => Array
                    (
                    )
    
            )
    
        [4] => Array
            (
                [file] => /home/northdev/public_html/wp-includes/template-loader.php
                [line] => 74
                [args] => Array
                    (
                        [0] => /home/northdev/public_html/wp-content/themes/suffusion_camra/no-sidebars.php
                    )
    
                [function] => include
            )
    
        [5] => Array
            (
                [file] => /home/northdev/public_html/wp-blog-header.php
                [line] => 16
                [args] => Array
                    (
                        [0] => /home/northdev/public_html/wp-includes/template-loader.php
                    )
    
                [function] => require_once
            )
    
        [6] => Array
            (
                [file] => /home/northdev/public_html/index.php
                [line] => 17
                [args] => Array
                    (
                        [0] => /home/northdev/public_html/wp-blog-header.php
                    )
    
                [function] => require
            )
    
    )

Viewing 1 replies (of 1 total)
  • Thread Starter rl347

    (@rl347)

    I have solved this and I think I understand why.

    I am stupid!

    I am doing redirect in php code executed within wordpress page. It seems that headers have already been sent in this situation. On my development site, where I didn’t get ‘header sent’ I had enabled ‘WP Fastest Cache. On the operational Site I hadn’t. When I enabled it the problem went. Presumably the cache prog adds in that stuff later.

    (mind you when I tried the same with a different cache program the problem remained; maybe a different approach.)

    Ron

Viewing 1 replies (of 1 total)
  • The topic ‘Headers' Sent Traceback’ is closed to new replies.