2017-04-24 54 views
0

我從服務器收到以下錯誤:CKEditor的:致命錯誤:要求()[function.require]:未能開口要求 '__DIR __ /郎/ en.php')

Fatal error: require() [function.require]: Failed opening required '__DIR__/lang/en.php' (include_path='.:/usr/local/php5/lib/php') in /home/content/38/8264638/html/console/assets/ckeditor/plugins/imageuploader/imgbrowser.php on line 16

在我的我的CKEditor整合imageuploader和工作在我的本地服務器,但它不是在託管server.its工作並稱imagebrowser.php文件中的錯誤以下是imagebrowser.php..please代碼幫助我..

<?php 
session_start(); 
$link = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"; 
$root = "http://$_SERVER[HTTP_HOST]"; 

// checking lang value 
if(isset($_COOKIE['sy_lang'])) { 
    $load_lang_code = $_COOKIE['sy_lang']; 
} else { 
    $load_lang_code = "en"; 
} 

// including lang files 
switch ($load_lang_code) { 
    case "en": 
     require(__DIR__ . '/lang/en.php'); 
     break; 
    case "pl": 
     require(__DIR__ . '/lang/pl.php'); 
     break; 
} 

// Including the plugin config file, don't delete the following row! 
require(__DIR__ . '/pluginconfig.php'); 
// Including the functions file, don't delete the following row! 
require(__DIR__ . '/function.php'); 
// Including the check_permission file, don't delete the following row! 
require(__DIR__ . '/check_permission.php'); 

$_SESSION["username"] = "disabled_pw"; 

?> 

回答

2

你的PHP版本不支持__DIR__,因此它被視爲文字字符串。

你可以修復它,但你應該更新你的PHP版本。

dirname(__FILE__) 
+0

更新PHP版本是不是真的簡單的任務:) 它需要大量的effofrt –

+0

如何要求的(__ DIR__ '/lang/en.php');替換爲dirname(__ FILE__).. @ @黑暗的Absol(如何在我的代碼中實現) –

+0

@AlexandrKapustin當然,但從長遠來看這是最好的解決方案。例如,如果我們可以說服每個人升級到PHP7,那麼我們不會再有人抱怨說'mysql_fetch_assoc'希望參數1是資源,布爾值給定。 –