Community Documentation

Drupal V5.x warning: Cannot add header information

Last updated August 26, 2009. Created by wheatbix on March 24, 2007.
Edited by bekasu. Log in to edit this page.

A very common error while trying to modify the user profile in Drupal 5.x is:

warning: Cannot add header information - headers already sent

This is usually an issue associated with line breaks or text file encoding.

Confirmed Solution for Drupal 5.1

  • Stop using MS Notepad, Download Context ( http://www.context.cx/ )
  • Make sure all your files are in DOS (ANSI) not Unicode. (Context -> Convert Test To -> Dos)
  • Usually the files that are in Unicode are the ones that display in the error message.
  • /includes/theme.inc
  • /includes/common.inc
  • theme-dir/template.php
  • theme-dir/user_profile.tpl.php
  • Eliminate all but 1 line break from the end of all of the php (template and user_profile) and inc (/includes/*) files.

    Please only post specific solutions to your problem as comments.

  • About this page

    Drupal version
    Drupal 5.x, Drupal 6.x, Drupal 7.x

    Theming Guide

    Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.