14

我已经在 XAMPP 中部署了我的源代码。我收到以下错误。

注意:只有变量引用应该在 C:\xampp\htdocs\3c_app\public_html\system\core\Common.php 中的第 257 行通过引用返回
致命错误:在 C:\xampp\htdocs\3c_app 中找不到类 'CI_Controller' \public_html\system\core\CodeIgniter.php 在第 233 行。

我的源文件是:

通用.php

// Are any values being dynamically replaced?
    if (count($replace) > 0)
    {
        foreach ($replace as $key => $val)
        {
            if (isset($config[$key]))
            {
                $config[$key] = $val;
            }
        }
    }

    return $_config[0] =& $config;
}

第 257 行是: return $_config[0] =& $config;

Codeigniter.php

// Fetch the config file
    if ( ! file_exists($file_path))
    {
        exit('The configuration file does not exist.');
    }

    require($file_path);

第 233 行:if ( ! file_exists($file_path))

有谁能帮忙???

4

4 回答 4

41

试试这个:

在您的 Common.php 中更改它

if (count($replace) > 0){
    foreach ($replace as $key => $val){
        if (isset($config[$key])){
            $config[$key] = $val;
        }
    }
}

$_config[0] =& $config;
return $_config[0];

有关更多参考,另请参见此处:reference-Codeigniter 仅应返回变量引用。我希望这有帮助。

于 2015-06-12T01:05:35.230 回答
16

Common.php 中改变这个

return $_config[0] =& $config;

对此

$_config[0] =& $config;
return $_config[0];

问题在于分配和返回数据。

于 2015-06-12T03:38:43.603 回答
2

如果您的代码仍然无法正常工作,那么试试这个

$_config[1]=& $config;
return $_config[0];
于 2016-09-16T11:27:05.237 回答
0

Codeigniter 本身现在修复了该错误。

您只需在此处更新 Codeigniter 的当前更新版本。

它将解决您的错误。

于 2018-12-10T05:18:06.563 回答