Title: Error establishing a database connection (Cannot modify header information)
Last modified: August 31, 2016

---

# Error establishing a database connection (Cannot modify header information)

 *  [kokroy](https://wordpress.org/support/users/kokroy/)
 * (@kokroy)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-cannot-modify-header-information/)
 * Hi,
 * I’ve a big (database connection) problem after moving my website to a new registrar.
 * This is the error I get:
 * >  Warning: Cannot modify header information – headers already sent by (output
   > started at /home/iphone1q/public_html/wp-config.php:1) in /home/iphone1q/public_html/
   > wp-includes/functions.php on line 3503
   > Error establishing a database connection
 * This is the wp-config file:
 *     ```
       <?php
       /** Enable W3 Total Cache */
       define('WP_CACHE', true); // Added by W3 Total Cache
   
       /** Enable W3 Total Cache Edge Mode */
       define('W3TC_EDGE_MODE', true); // Added by W3 Total Cache
   
       /**
        * The base configurations of the WordPress.
        *
        * This file has the following configurations: MySQL settings, Table Prefix,
        * Secret Keys, and ABSPATH. You can find more information by visiting
        * {@link https://codex.wordpress.org/Editing_wp-config.php Editing wp-config.php}
        * Codex page. You can get the MySQL settings from your web host.
        *
        * This file is used by the wp-config.php creation script during the
        * installation. You don't have to use the web site, you can just copy this file
        * to "wp-config.php" and fill in the values.
        *
        * @package WordPress
        */
   
       // ** MySQL settings - You can get this info from your web host ** //
       /** The name of the database for WordPress */
       define('DB_NAME', 'iphone1q_1');
   
       /** MySQL database username */
       define('DB_USER', 'iphone1q_iphone');
   
       /** MySQL database password */
       define('DB_PASSWORD', ‘xxxx’);
   
       /** MySQL hostname */
       define('DB_HOST', 'localhost');
   
       /** Database Charset to use in creating database tables. */
       define('DB_CHARSET', 'utf-8');
   
       /** The Database Collate type. Don't change this if in doubt. */
       define('DB_COLLATE', '');
   
       define( 'WP_ALLOW_REPAIR', true );
   
       /**#@-*/
   
       /**
        * WordPress Database Table prefix.
        *
        * You can have multiple installations in one database if you give each a unique
        * prefix. Only numbers, letters, and underscores please!
        */
       $table_prefix  = 'wp_';
   
       /**
        * For developers: WordPress debugging mode.
        *
        * Change this to true to enable the display of notices during development.
        * It is strongly recommended that plugin and theme developers use WP_DEBUG
        * in their development environments.
        */
       define('WP_DEBUG', false);
   
       /* That's all, stop editing! Happy blogging. */
   
       /** Absolute path to the WordPress directory. */
       if ( !defined('ABSPATH') )
       	define('ABSPATH', dirname(__FILE__) . '/');
   
       /** Sets up WordPress vars and included files. */
       require_once(ABSPATH . 'wp-settings.php')
       ?>
       ```
   
 * This is line 3503 in functions.php:
    `header( 'Content-Type: text/html; charset
   =utf-8' );`
 * Does someone know what the problem could be?
 * Many thanks!
 * Kind regards,
    Roy

Viewing 1 replies (of 1 total)

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-cannot-modify-header-information/#post-7141706)
 * – Try reviewing this codex to solve header already sent problem: [http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F](http://codex.wordpress.org/FAQ_Troubleshooting#How_do_I_solve_the_Headers_already_sent_warning_problem.3F)

Viewing 1 replies (of 1 total)

The topic ‘Error establishing a database connection (Cannot modify header information)’
is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [t-p](https://wordpress.org/support/users/t-p/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/error-establishing-a-database-connection-cannot-modify-header-information/#post-7141706)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
