【问题标题】:ckeditor:Fatal error: require() [function.require]: Failed opening required '__DIR__/lang/en.php')ckeditor:致命错误:require()[function.require]:打开失败需要'__DIR__/lang/en.php')
【发布时间】:2017-04-24 08:11:30
【问题描述】:

我从服务器收到以下错误:

致命错误:require() [function.require]:在 / 中打开所需的 '__DIR__/lang/en.php' (include_path='.:/usr/local/php5/lib/php') 失败home/content/38/8264638/html/console/assets/ckeditor/plugins/imageuploader/imgbrowser.php 在第 16 行

在我的 ckeditor 中,我集成了 imageuploader 及其在我的本地服务器中的工作,但它在托管服务器中不起作用。它在 imagebrowser.php 文件中说错误以下是 imagebrowser.php 中的代码..请帮助我..

<?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"; 

?>

【问题讨论】:

    标签: php mysql codeigniter


    【解决方案1】:

    您的 PHP 版本不支持 __DIR__,因此它被视为文字字符串。

    你可以修复它,但你应该更新你的 PHP 版本。

    dirname(__FILE__)
    

    【讨论】:

    • 更新 PHP 版本并不是一件小事 :) 它需要很多努力
    • 如何要求(DIR . '/lang/en.php');替换为 dirname(FILE) ..@Niet the Dark Absol(如何在我的代码中实现)
    • @AlexandrKapustin 当然,但从长远来看,这是最好的解决方案。例如,如果我们能够说服所有人升级到 PHP7,那么我们将不再有人抱怨 mysql_fetch_assoc 期望参数 1 是资源,给定布尔值。
    猜你喜欢
    • 1970-01-01
    • 2011-08-04
    • 2015-02-13
    • 1970-01-01
    • 1970-01-01
    • 2014-06-12
    • 2021-06-11
    • 2017-10-11
    • 2016-07-06
    相关资源
    最近更新 更多