【发布时间】:2023-04-09 22:44:01
【问题描述】:
这个字符串有问题
'Require.www' => false
这段代码给了我错误:
>Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in C:\xampp\KERNEL-DOCMS\Server.Config.php on line 5
我该如何解决这个问题?它在在线游戏的服务器配置中。
完整代码为:
## 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
【问题讨论】:
-
您没有显示相关代码。提供完整的声明。
-
在最后一条注释上展开,像这样的错误可以在实际错误之后显示行号,因为上一行末尾缺少符号会导致下一行语法无效。