2015-10-20 66 views
1

我在我的MAC OS安装好vtiger发现。PHP变量不能与vtigerCRM的代码

访问index.php

Notice: Undefined variable: mod_strings in /Applications/XAMPP/xamppfiles/htdocs/vtigercrm/modules/CustomView/CustomView.php on line 17 

当我收到此错误,以便错误明确表示,有一个变量mod_strings未被识别。

我去index.php,我发现这一点:

include_once 'include/Webservices/Relation.php'; 
include_once 'vtlib/Vtiger/Module.php'; 
include_once 'includes/main/WebUI.php'; 

$webUI = new Vtiger_WebUI(); 
$webUI->process(new Vtiger_Request($_REQUEST, $_REQUEST)); 

正如你看到的,错误告诉我,该变量是在CustomView.php。所以,我打开这个文件,我发现了以下:

require_once('data/CRMEntity.php'); 
require_once('include/utils/utils.php'); 
require_once 'include/Webservices/Utils.php'; 

正如你看到的,代码将使用称为CRMEntity PHP脚本,我打开这个文件,我发现这一点:

global $adb, $mod_strings; 

所以看变量IS那里。为什么我得到那个错误?

+0

瓦您安装了PHP的PHP版本吗? –

+0

@RalphMelhem我有XAMPP 5.6.12-0我不知道用哪个版本而来。 –

+0

运行phpinfo();并让我知道它显示哪个版本的PHP,这可能是一个兼容性问题 –

回答

0

根据系统要求here,你应该配置你的php.ini以下内容:在的phpinfo

使用error_reporting E_WARNING上

检查&〜E_NOTICE &〜E_DEPRECATED 的display_errors()的位置正在使用的php.ini并应用更改,然后重新启动您的服务器和测试

0

很抱歉这么晚才回复,我试图安装好vtiger,我坚持了同样的错误,你给了我很好的提示,l IKE你说,$mod_strings声明globalCRMEntity.php SP为了解决这个问题,只需将其添加到全局声明中CustomView.php像这样:

require_once 'data/CRMEntity.php'; 
require_once 'include/utils/utils.php'; 
require_once 'include/Webservices/Utils.php'; 
// add $mod_strings 
global $adv_filter_options, $mod_strings; 
// the rest of the code ... 
$adv_filter_options = array("e" => "" . $mod_strings['equals'] . "", 
// ... 

您可能还需要隐藏才能看到的错误安装页面(你不能纠正所有的错误,正好有很多,你可能希望你开发了自己的CRM)

"vtigercrm\include\logging.php"顶部添加以下

// hide errors 
ini_set('display_errors', '0'); 
// but log them 
error_reporting(e_all | e_strict); 
+0

不应该是'error_reporting('e_all'|'e_strict');'而不是? – Tunaki