Moderator
t-p
(@t-p)
– 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
(@feliciaarthousecreativecom)
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
(@t-p)
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.
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.ww.wp.xz.cn/browser/branches/4.7/wp-config-sample.php
Thread Starter
felicia
(@feliciaarthousecreativecom)
@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
(@feliciaarthousecreativecom)
@t-p I’m unable to access my site’s admin. I get an Internal Server Error. Are these issues related?
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.ww.wp.xz.cn/Editing_wp-config.php
Then upload the new file and try again.