Title: Syntax Error in wpconfig.php
Last modified: December 10, 2016

---

# Syntax Error in wpconfig.php

 *  [felicia](https://wordpress.org/support/users/feliciaarthousecreativecom/)
 * (@feliciaarthousecreativecom)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-in-wpconfig-php/)
 * Hello,
 * I’m in the process of moving a site from my server to another server and I’m 
   getting an error in the wpconfig.php:
 * Parse error: syntax error, unexpected ”);’ (T_CONSTANT_ENCAPSED_STRING) in /home/
   ksypolt619/public_html/wp-config.php on line 69
 * This is what the code looks like on that line:
    /** Database Charset to use in
   creating database tables. */
 * define(‘DB_CHARSET’, ‘utf8’);
 * I appreciate any help or suggestions. Thank you!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-in-wpconfig-php/#post-8538951)
 * – A syntax error indicates that you may have made a mistake while creating your
   PHP structure. When this error appears it will tell you which file the error 
   appears in (e.g., functions.php) and approximately which line (**it may not always
   be the exact line so be sure to check just before and just after) in the code.**
 * Try:
    – fix PHP structure in the file around the line indicated in the error 
   message – or, upload a fresh copy (unedited) of this file – or, upload a fresh
   copy of your theme. If you immediately need to get in the dashboard, you can 
   switch to the default theme by renaming your currently active theme’s folder 
   inside /wp-content/themes/ and adding “-old” to the end of the folder name using
   FTP or SFTP or any whatever file management application your host provides.
 *  Thread Starter [felicia](https://wordpress.org/support/users/feliciaarthousecreativecom/)
 * (@feliciaarthousecreativecom)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-in-wpconfig-php/#post-8538961)
 * Thank you for your reply!
 * Since I’m migrating the site, I created a new database on the new server which
   is functioning fine (I checked it) but I had to change the wpconfig.php to reflect
   the new database. As you can see from the error I posted above, it’s coming from
   the wpconfig.php file on line 69 which is this line:
 * /** Database Charset to use in creating database tables. */
 * define(‘DB_CHARSET’, ‘utf8’);
 * Here’s the exact error:
    Parse error: syntax error, unexpected ”);’ (T_CONSTANT_ENCAPSED_STRING)
   in /home/ksypolt619/public_html/wp-config.php on line 69
 * Any idea why this is happening? I tried changing the PHP version and that didn’t
   help. Thank you!
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-in-wpconfig-php/#post-8538976)
 * As I mentioned in my previous reply:
    it may not always be the exact line so 
   be sure to check just before and just after.
 * To fix, try:
    – fix PHP structure in the file around the line indicated in the
   error message – or, upload a fresh copy (unedited) of this file – or, upload 
   a fresh copy of your theme. If you immediately need to get in the dashboard, 
   you can switch to the default theme by renaming your currently active theme’s
   folder inside /wp-content/themes/ and adding “-old” to the end of the folder 
   name using FTP or SFTP or any whatever file management application your host 
   provides.
 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/syntax-error-in-wpconfig-php/#post-8539050)
 * >  it’s coming from the wpconfig.php file on line 69 which is this line:
   > /** Database Charset to use in creating database tables. */
   > define(‘DB_CHARSET’, ‘utf8’);
 * That should normally be around line 34-35, not line 69.
 *  Here’s what the default file looks like for comparison. [https://core.trac.wordpress.org/browser/branches/4.7/wp-config-sample.php](https://core.trac.wordpress.org/browser/branches/4.7/wp-config-sample.php)
 *  Thread Starter [felicia](https://wordpress.org/support/users/feliciaarthousecreativecom/)
 * (@feliciaarthousecreativecom)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-in-wpconfig-php/#post-8540888)
 * [@claytonjames](https://wordpress.org/support/users/claytonjames/) I swapped 
   out the default file you mentioned with what I had previously and updated the
   info for the database name, admin and
    password but now I get this error:
 * Parse error: syntax error, unexpected ’20’ (T_LNUMBER) in /home/ksypolt619/public_html/
   wp-config.php on line 20
 *  Thread Starter [felicia](https://wordpress.org/support/users/feliciaarthousecreativecom/)
 * (@feliciaarthousecreativecom)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-in-wpconfig-php/#post-8540892)
 * [@t-p](https://wordpress.org/support/users/t-p/) I’m unable to access my site’s
   admin. I get an Internal Server Error. Are these issues related?
 *  [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * (@claytonjames)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-in-wpconfig-php/#post-8541079)
 * If there is something wrong with your wp-config.php file, then nothing else is
   going to work. That needs to be fixed first.
 * A syntax error means there has been a mistake while editing the file. Don’t edit
   the file with anything other than a plain text editor. Start with a fresh copy
   of the file, and follow these instructions for editing wp-config.php. [https://codex.wordpress.org/Editing_wp-config.php](https://codex.wordpress.org/Editing_wp-config.php)
 * Then upload the new file and try again.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Syntax Error in wpconfig.php’ is closed to new replies.

## Tags

 * [parse-error](https://wordpress.org/support/topic-tag/parse-error/)
 * [syntax error](https://wordpress.org/support/topic-tag/syntax-error/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 3 participants
 * Last reply from: [Clayton James](https://wordpress.org/support/users/claytonjames/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/syntax-error-in-wpconfig-php/#post-8541079)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
