0

当我尝试在我的网站上安装 cometchat 时出现此错误

解析错误:语法错误,第 18 行 /home3/user/public_html/mysite/cometchat/integration.php 中的意外“{”

这是第 18 到 21 行的代码

if (!file_exists((dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'config.php')) {
    echo "Please check if cometchat is installed in the correct directory.<br /> The 'cometchat' folder should be placed at <VLDPERSONALS_HOME_DIRECTORY>/cometchat";
    exit;
}

有人可以告诉我出了什么问题并分享正确的代码修复

非常感谢

4

3 回答 3

0

你少了一个括号。

if ( !file_exists( (dirname(dirname(FILE)).DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'config.php') ) ) {
    echo "Please check if cometchat is installed in the correct directory. The 'cometchat' folder should be placed at /cometchat"; exit;
}
于 2013-08-23T01:37:48.407 回答
0

您缺少右括号。尝试

if (!file_exists((dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'config.php'))) { // note there are three brackets at the end of the line
    echo "Please check if cometchat is installed in the correct directory.<br /> The 'cometchat' folder should be placed at <VLDPERSONALS_HOME_DIRECTORY>/cometchat";
    exit;
}
于 2013-08-23T01:38:06.823 回答
-1

这个问题看起来很简单。您的代码中有额外的括号:我已经修改了代码。

if(!file_exists(dirname(dirname( FILE )).DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'config.php')) { echo "请检查cometchat是否安装在正确的目录
下,'cometchat'文件夹应该放在在 /cometchat"; 出口; }

于 2015-01-22T10:01:54.320 回答