代码点火器错误:变量引用


CodeIgniter Error: variable references

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

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

我的源文件是:

常见.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;

代码点火器.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))

任何人都可以帮忙吗???

试试这个:

在您的公共中更改它.php

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

另请参阅此处,以获取更多参考:仅应通过引用返回变量引用 - Codeigniter 。我希望这有所帮助。

共同点.php 更改此

return $_config[0] =& $config;

对此

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

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

如果您的代码仍然无法正常工作,请尝试此操作

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

Codeigniter 本身现在修复了这个错误。

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

它将解决您的错误。