WordPress.org

Ready to get started?Download WordPress

Forums

Warning: Cannot modify header information - query.php (8 posts)

  1. barryofguilder
    Member
    Posted 3 years ago #

    I started a brand new WordPress website today using 3.0.1. When I try to go to any of the pages (not posts) that I created, I get the following error:

    Notice: Only variables should be assigned by reference in /home/content/b/r/o/brookoflife/html/bol_wp/wp-includes/query.php on line 1508

    Warning: Cannot modify header information - headers already sent by (output started at /home/content/b/r/o/brookoflife/html/bol_wp/wp-includes/query.php:1508) in /home/content/b/r/o/brookoflife/html/bol_wp/wp-includes/pluggable.php on line 890

    It's really weird, because it's in one of the core files and I don't mess with those. I went to line 1508 in the query.php file and noticed the following line:

    $this->queried_object =& get_page_by_path($qv['pagename']);

    I removed the ampersand, saved the file, and I don't get the error anymore. The pages display like normal.

    Has anyone come across this? I'm kind of worried since I just modified a core WordPress file. I don't want this to start screwing up later on. Any help would be appreciated.

  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. barryofguilder
    Member
    Posted 3 years ago #

    Yes, I know about that, but this did not solve my problem.

  4. Samuel B
    moderator
    Posted 3 years ago #

    put the code back
    deactivate your plugins and test
    re-activate one by one testing in between

  5. dj3huti
    Member
    Posted 3 years ago #

    With respect, Samuel B, that's not helpful. This is caused by having the wordpress core failing strict error reporting for php 5.2 and up.

    "only variables should be assigned by reference"

    I'm assuming strict is usually turned off in WP, but it really should be coded to be compliant.

  6. bobcouttie
    Member
    Posted 3 years ago #

    I'm getting something similar but only with pages:

    "Notice: Only variables should be assigned by reference in ****/wp-includes/query.php on line 1600"

  7. stpitner
    Member
    Posted 3 years ago #

    I'm in the same situation as bobcouttie - on just my pages I am receiving the warning in regards to this warning. I'm using WP 3.1.3.

    Notice: Only variables should be assigned by reference in /<removed>/wp-includes/query.php on line 1600

  8. stpitner
    Member
    Posted 3 years ago #

    I found out that the site I was working on was still using PHP 4.4, something like that. I upgraded it to PHP 5.2, and the Warning goes away. Everyone is going to have to upgrade to PHP 5.2 in order to run 3.2, so this issue presumably will become moot really fast.

Topic Closed

This topic has been closed to new replies.

About this Topic