b2evolution b2evolution

  • Sign in
  • Sign up
  • About
  • Downloads
  • Hosting
  • Docs
  • Support
  • Sign in
  • Sign up
  • Manuals Home
  • Latest Updates
 
  1. b2evolution CMS User Manual
  2. Operations Reference
  3. Troubleshooting
  4. "Warning: Cannot modify header information"

"Warning: Cannot modify header information"

The PHP warning

Warning: Cannot modify header information - headers already sent

is caused, because there’s output (from PHP) already, when there’s a call to e.g. header(), which cannot send a HTTP header then anymore.

If you get this error, it is most likely you recently changed something in a file (e.g. a configuration file in /conf).

The error is often caused by added whitespace (space or line feed) *before* the first <?php or *after* the closing ?>.

You can remove the error by opening the file stated in the notice and remove the whitespace. Because whitespace is often hard to detect, you may want to use a fresh copy of the file and make the changes anew.

Do use a plain text editor like Notepad++ on Windows or textmate on Mac OS for editing B2evo files. Do not use a HTML editor or Word.

Usually the location of the error is given in the error message itself:

 Warning: Cannot modify header information - headers already sent by
 (output started at /path/to/file/with/output:LINE)
 in /path/to/file/with/warning on line X

Take a look at /path/to/file/with/output, especially at/around line LINE.

If there’s no "output started at" info given, you’re kinda out of luck. The only possible solution (apart from ‘’taking a look at the file’s you’ve modified'’) seems to be adding manually echo "foo"; statements into the code to see if the error already gets triggered here (then the /path/to/file/with/warning and "line X" would change accordingly).

Created by fplanque • Last edit by fplanque on 2020-06-09 00:25 • •

No feedback yet

Search the Manual

Content Hierarchy

  • b2evolution CMS User Manual
  • User's Guide
  • Installation / Upgrade
  • Front-office Reference
  • Back-office Reference
  • Developer Reference
  • Operations Reference
    • Security
    • Fighting Spam
    • Performance
    • Using Multiple Domains
    • Intranet setup
    • LDAP Integration
    • Troubleshooting
      • My users do not have access to the files section / upload
      • I made a change but my blog is not updated
      • Troubleshooting Cookie Issues
      • I get file permission errors. How do I fix them?
      • When I do X I get a blank page or only a half page
      • "Warning: Cannot modify header information"
      • Emails don't arrive / Email notifications don't work
      • I have a MySQL error
      • Illegal mix of collations
      • phpMyAdmin
      • Http Post Data Too Large
      • Email Deliverability
      • I'm having weird redirect issues
      • Dev Menu
      • Error message not by b2evolution
    • Bundled Plugins
  • Advanced Topics
  • Glossary
  • Archives
Community CMS

This online manual is powered by b2evolution CMS – A complete engine for your website.

About b2evolution

  • What is it?
  • Features
  • Getting Started
  • Screenshots
  • Online demo
  • Testimonials
  • Design philosophy
  • Free & open source
  • Terms of service

Downloads

  • Latest releases
  • Skins
  • Plugins
  • Language packs

About us

  • About us
  • Contact

Webhosting Guide

  • Web hosting blog
  • Best web hosting
  • Cheap web hosting
  • Green web hosting
  • Hosting with SSH
  • VPS hosting
  • Dedicated servers
  • Reseller hosting
  • Int'l: UK / France

Docs & Support

  • Online manual
  • Forums
  • Hire a pro !

Other

  • Adsense
  • Press room
  • Privacy policy

Stay in touch

  • GitHub
  • Twitter
  • Facebook
  • LinkedIn
  • News blog
  • RSS feed
  • Atom feed

Founded & Maintained by François Planque