【问题标题】:PHP Parse error: syntax error, unexpected 'DB_USER' (T_STRING), expecting ',' or ')' in /var/www/wordpress/wp-config.php on line 26 [duplicate]PHP解析错误:语法错误,意外的'DB_USER'(T_STRING),期望','或')'在/var/www/wordpress/wp-config.php第26行[重复]
【发布时间】:2018-06-23 07:05:44
【问题描述】:

我在 /var/www/wordpress/wp-config.php 中发现了这个错误,

但我找不到错误

<?php

/** The name of the database for WordPress */
define('DB_NAME', 'wordpress_db);

/** MySQL database username */
define('DB_USER', 'username_here');

/** MySQL database password */
define('DB_PASSWORD', 'wp_password');

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

/** 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', '');


define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

从我的角度来看,一切似乎都是正确的,我错过了什么?

维克多

【问题讨论】:

  • 你看过第四行缺少的引号了吗?
  • 仔细查看 SO 上突出显示的语法。它很容易揭示问题 - 合适的编辑器会给您相同(或相似)的突出显示。
  • @smith 你为什么不实际投票关闭它?
  • @Mike 投票关闭需要 3000 声望。 ;-) 简单地标记就是 15 声望。 stackoverflow.com/help/privileges
  • @Qirel 啊,我还以为少了..

标签: php mysql wordpress


【解决方案1】:

这是一个语法错误。您在wordpress_db 之后的第 3 行中错过了结束语。

改变

define('DB_NAME', 'wordpress_db);

define('DB_NAME', 'wordpress_db');

它将解决您的问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-19
    • 1970-01-01
    • 2015-03-09
    • 1970-01-01
    • 2019-05-21
    • 1970-01-01
    • 2018-06-23
    • 2014-01-16
    相关资源
    最近更新 更多