Forums

wp-config.php has no ending php tag (3 posts)

  1. Who_Dat
    Member
    Posted 1 year ago #

    I was trying to track down the origin of a "Headers already sent" warning (ultimately successfully), and went first to the wp-config.php file to make sure there were no spaces before the starting or after the ending php tag. And I discovered something curious: there is no ending php tag.

    I checked the original download: no ending tag. I checked the files in every archived download I have: no ending tag. I downloaded a new copy of 3.3.2 and checked the wp-config-sample.php file: no ending tag.

    Yet every source I checked was specific about checking both the start and end of the config file, including the Codex itself. In fact, the Codex states

    The last thing in the file should be ?> and nothing else.

    Well, I don't have one. Yet the install works. So what's going on?

  2. Ross Hanney
    Member
    Posted 1 year ago #

    Ending PHP tags are unnecessary, in general. The ending tag from wp-config.php was removed 3 years ago, and from other core files more recently.

    The Codex should probably be updated to reflect this.

  3. Who_Dat
    Member
    Posted 1 year ago #

    Thanks. Was freaking out for awhile, there.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.