I transferred my files via FTP and database to a hosting service. I edited two files, settings.php and sites/default/settings.php whose content was originally the following.

$databases = array (
  'default' => 
  array (
    'default' =>
    array (
      'database' => 'db',
      'username' => 'loginname',
      'password' => 'passwd',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => '',

I changed the database name, username, password and host (to yes.domainname.com) in both files.

There is probably something wrong because I get this warning.

Warning: Cannot modify header information - headers already sent by (output started at /web/www/yes.domainname.com/sites/default/settings.php:1) in drupal_send_headers() (line 1044 of /web/www/yes.domainname.com/includes/bootstrap.inc).

Do you know what is wrong?

1 Answer 1


Verify that there are not extra characters at the beginning of the file, right before the <?php part; this would cause the error you have seen.
Sometimes the editors add the BOM (Byte Order Mark) when saving an Unicode file; verify Unicode is not the text encoding used to save the file, or that the editor is not set to add the BOM to the files it saves as Unicode.
The BOM characters are not normally visible in a text editor; if the editor has the option to show characters that have a specific code, or "invisible characters," that can help to notice them.

Alternatively, the file got corrupted when transferred.

  • Thank you. I uploaded the two files again and edited it with gvim instead of oowriter (from open office) and it helped. I let host as localhost and it works. Is it better to let it as localhost or use rather yes.domainname.com?
    – xralf
    Jul 10, 2011 at 18:20
  • 1
    I would rather use the domain name used by the website.
    – apaderno
    Jul 10, 2011 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.