PHP Parse error: syntax error, unexpected '!', expecting ',' or ')' in /var/www/html/wp-config.php on line 29

June 14, 2017 216 views
PHP Ubuntu

I'm trying to migrate my wordpress to my new server, however, I'm getting this syntax error that I can't quite seem to figure out...

PHP Parse error:  syntax error, unexpected '!', expecting ',' or ')' in /var/www/html/wp-config.php on line 29

EDIT: I blocked out my password, but I can tell you it has a ! in it and is on Line 29...

This is my config file:

 * The base configuration for WordPress
 * The wp-config.php creation script uses this file during the
 * installation. You don't have to use the web site, you can
 * copy this file to "wp-config.php" and fill in the values.
 * This file contains the following configurations:
 * * MySQL settings
 * * Secret keys
 * * Database table prefix
 * @link
 * @package WordPress

// ** MySQL settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define('DB_NAME', ‘wordpress’);

/** MySQL database username */
define('DB_USER', ‘XXX’);

/** MySQL database password */
define('DB_PASSWORD', ‘XXX’);

/** MySQL hostname */
define('DB_HOST', 'XXX');

/** Database Charset to use in creating database tables. */
define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */
define('DB_COLLATE', '');

 * Authentication Unique Keys and Salts.
 * Change these to different unique phrases!
 * You can generate these using the {@link secret-key service}
 * You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
 * @since 2.6.0
define('AUTH_KEY',         '/ofPBMEzLA#Y4cY$vn12jffu|</NrOV3o0t3]<j;Q?:IzOL:`dw-7tpH$+Xc-K_W');
define('SECURE_AUTH_KEY',  'XQ2)7u+};Nf(zO^j6AuD6$4?{{y_[0(>/yhW$$+.34&aQpwJ/!2XV*P}F)x5Yn=`');
define('LOGGED_IN_KEY',    'JaeJ|Z-k<)s[5%#TsUnaJV05N;fpriVb/^ZPnow7RjXnp+v+lH}~@j!F-)(-b%:j');
define('NONCE_KEY',        'p+YVH?v0hpX_]2TqAZq4H;/x0g%i}lEqlVi~6?C-4V3:|GTFBQD}2,Y|cMN?bnX$');
define('AUTH_SALT',        'wKeFLq<4&B%h[4J`]r|+QGIuL4Kgp7Gyj `%}w:k5^7RnD<(<~lJJ?D+-yqzy5-(');
define('SECURE_AUTH_SALT', 'KeM1BN0r`{H/:qw0+ao8^!pb~$^/{5jTtmrsfxPUnUb*S[y1/9}l<;/^b=V,~+Mw');
define('LOGGED_IN_SALT',   '`-rZ7@T(P-ER)#=[z5vns!!1v+>MIpTm4=jC|nIx4SZJrv8st59=kAR;LIMA(V?h');
define('NONCE_SALT',       'W-6.So.)%sfN.(9}-q)3!f52PY{V0jgv0Ez4^rRIFEN+*[|B--P+OP(;4.P+.N,X');

 * Other customizations.

 * Turn off automatic updates since these are managed upstream.


 * 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.
 * For information on other constants that can be used for debugging,
 * visit the Codex.
 * @link
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');

1 Answer


If you're wp-config.php file is as shown, then it looks like you're using back ticks in place of single or double quotes for:


You'll want to double check the values and make sure they are surrounded by single quotes, or, if the password you're using has a single quote in it, that you use double quotes instead.

For example, if my password was:


There's a single quote in it, thus if I surround the password in single quotes, it never gets escaped. I'd need to surround it in double quotes.


That said, once you make any changes, since your salts were pasted, please make sure you visit:

... to generate new salts and overwrite your existing.

Have another answer? Share your knowledge.