2015-10-20 35 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