• 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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter barryofguilder

    (@barryofguilder)

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

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

    dj3huti

    (@dj3huti)

    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.

    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”

    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

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Warning: Cannot modify header information – query.php’ is closed to new replies.