我有一个问题,这个字符串解析错误:语法错误意外T_CONSTANT_ENCAPSED_STRING
'Require.www' => false
此代码给我的错误:
>Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\KERNEL-DOCMS\Server.Config.php on line 5
我该如何解决这个问题?它位于在线游戏的serverconfig中。
完整的代码是:
## URL
$Config['URL'] =
'Default'
'Require.www' => false, // www.example.com
'SSL.enabled' => true, // https://
'Server' => '***', // public server
'Lang' => 'en_US' // GLOBAL.
,
'Other' =>
//'example.com' => ['Require.www' => false, 'SSL.enabled' => false, 'Lang' => 'es_ES', 'MySQL' => ['host' => '127.0.0.1','user' => 'root','pass' => '','dbname' => 'cmsdb']]
,
'devPrivateServer' => 'localhost' // private developer server
;
## SQL Server Data
$Config['MySQL'] =
'host' => '127.0.0.1',
'user' => '***',
'pass' => '***',
'dbname' => 'do'
;
// Do not tuch the code below this text if yuo do not know what yuo're doing
define("DB_DSN", "mysql:host".$Config['MySQL'] ['host'].";dbname".$Config['MySQL']['dbname']."");//this constant will
define ("DB_USERNAME", $Config['MySQL']["user"]); //username of database
define ("DB_PASSWORD", $Config['MySQL']["pass"]); //username of database
define ("CLS_PATH", "class"); //the class path of our project
你没有显示相关的代码。提供完整的声明。 – mithunsatheesh 2014-10-04 12:50:50
以扩展最后一条评论,像这样的错误可以显示实际错误后的行号,因为上一行末尾的缺失符号可能导致下一行成为无效语法。 – JimL 2014-10-04 12:52:36