Skip to:
Content
Pages
Categories
Search
Top
Bottom

Suddenly "?>" displays on the top line of all bbPress pages

  • Several days ago I did a new install of bbpress in my wordpress root on localhost/, checked it out and all looked fine. My intention is to work through the integration of wp and bbp, but I didn’t have time to work with it then, so I went back today to try it out and find that there’s a misplaced “?>” displaying at the top of every page – before the header. I also noticed that the footer on the Appearance page of the admin panel runs across the Kakumei-blue theme so that the activate link is inaccesible.

    I’ve messed around with it for a few hours – saved my bb-config.php, deleted bbpress/ and replaced it from the zip; checked permissions; repaired my mysql database; restarted my apache2 and mysql services; checked the header.php; cleared my browser cache… I’m at a loss to understand this.

    ?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">

    <head>

    <meta http-equiv="X-UA-Compatible" content="IE=8" />

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>bbPress Bulletin Board</title>

    <link rel="stylesheet" href="http://localhost/wordpress/bbpress/bb-templates/kakumei/style.css" type="text/css" />

    <link rel=”alternate” type=”application/rss+xml” title=”bbPress Bulletin Board » Recent Posts” href=”http://localhost/wordpress/bbpress/rss.php&#8221; />

    <link rel=”alternate” type=”application/rss+xml” title=”bbPress Bulletin Board » Recent Topics” href=”http://localhost/wordpress/bbpress/rss.php?topics=1&#8243; />

    <meta name=”generator” content=”bbPress 1.0.2″ />

    </head>

    I’m just short of removing the database and starting over, which would be the quick and easy way out, but I would like to figure it out for the heck of it. Any ideas will be appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Ok, so I got impatient, dropped the database, removed bbPress from wordpress root, restarted my apache2 and mysql services, cleared the browser cache, closed the browser, created a new database, unzipped bbPress into the wordpress root, logged in as the new user, logged out, and after logging out that php end tag is back.

    No plugins, no integration – no modifications of any kind, just out of the box bbPress. It’s a mystery to me.


    _ck_
    Participant

    @_ck_

    Sorry I missed this, anything that appears before all the headers is likely any other file you modified in bbpress startup process. Since the most likely file is bb-config.php which is often edited, you might have left two closing marks

    ?>

    ?>

    So the first one closes that PHP file, the second one gets displayed as plain text before the header.

    Boy do I feel stupid! That’s exactly what it was, and I don’t know how it happened. I copied the sample config file and renamed it, then added the database information. But after you suggested it I opened the file in bluefish, went to the bottom and found that the end ?> was not colored. There was an extra ?> at the end of the file. And I can’t figure for the life of me how it got there. (Makes me wonder if after missing something so simple I should even attempt integration!)

    Can’t thank you enough _ck_.


    _ck_
    Participant

    @_ck_

    Yeah the two common mistakes when editing PHP files is to mess up the closing or to put whitespace after the closing which then causes “headers already sent” error.

    The new preferred technique is to leave the closing off altogether, because PHP doesn’t care and it prevents errors like that – which I will probably adopt in my future code for plugins etc.

    Good to know. I’ll keep that in mind. Thanks again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.
Skip to toolbar