0

在扩展核心时遇到了 codeigniter 的问题。我在本地建立了一个网站,效果很好。即使在检查新机器或不同的 php 版本(在 5.3 和 5.2 上测试)时,它也可以正常工作。但是当我将它上传到我的服务器时,它不会加载应用程序/核心中的文件。我收到错误消息:

Fatal error: Class 'LEAN_Controller' not found in /var/www/vhosts/website/subdomains/w8systeem/httpdocs/application/controllers/wachtlijsten/overzicht.php on line 3

当我像这样输出加载的文件时:

print_r(get_included_files());

我得到这些结果: 本地主机:

Array ( [0] => C:\wamp\www\website\index.php [1] =>    
C:\wamp\www\website\system\core\CodeIgniter.php [2] =>    
C:\wamp\www\website\system\core\Common.php [3] =>    
C:\wamp\www\website\application\config\constants.php [4] =>     
C:\wamp\www\website\system\core\Benchmark.php [5] =>     
C:\wamp\www\website\application\config\config.php [6] =>     
C:\wamp\www\website\system\core\Hooks.php [7] =>     
C:\wamp\www\website\system\core\Config.php [8] =>     
C:\wamp\www\website\system\libraries\Log.php [9] =>     
C:\wamp\www\website\system\core\Utf8.php [10] =>     
C:\wamp\www\website\system\core\URI.php [11] =>     
C:\wamp\www\website\system\core\Router.php [12] =>     
C:\wamp\www\website\application\config\routes.php [13] =>     
C:\wamp\www\website\system\core\Output.php [14] =>     
C:\wamp\www\website\application\config\mimes.php [15] =>     
C:\wamp\www\website\system\core\Security.php [16] =>     
C:\wamp\www\website\system\core\Input.php [17] =>     
C:\wamp\www\website\system\core\Lang.php [18] =>     
C:\wamp\www\website\system\core\Controller.php [19] =>     
C:\wamp\www\website\application\core\lean_controller.php [20] =>     
C:\wamp\www\website\application\controllers\wachtlijsten\overzicht.php )

服务器:

Array ( [0] => /var/www/vhosts/website/subdomains/w8systeem/httpdocs/index.php [1] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/CodeIgniter.php [2] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Common.php [3] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/application/config/constants.php [4] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Benchmark.php [5] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/application/config/config.php [6] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Hooks.php [7] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Config.php [8] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/libraries/Log.php [9] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Utf8.php [10] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/URI.php [11] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Router.php [12] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/application/config/routes.php [13] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Output.php [14] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/application/config/mimes.php [15] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Security.php [16] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Input.php [17] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Lang.php [18] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/system/core/Controller.php [19] =>
 /var/www/vhosts/website/subdomains/w8systeem/httpdocs/application/controllers/wachtlijsten/overzicht.php ) 

我没主意了。不知道在哪里进一步搜索..

4

3 回答 3

1

默认情况下,CodeIgniter 只加载以 'CI_' 开头的核心文件,要更改这一点,因为您的文件以 'LEAN_' 开头,您需要更改config/config.php中的以下行:

$config['subclass_prefix'] = 'CI_';

$config['subclass_prefix'] = 'LEAN_';
于 2013-05-02T15:09:20.013 回答
0

检查您的代码点火器版本。我今天遇到了一个类似的问题,核心模块没有被拾取(< 2.0)。我现在正在迁移中。

于 2013-12-30T06:03:54.340 回答
0

C:\wamp\www\website\application\core\lean_controller.php

应该

C:\wamp\www\website\application\core\LEAN_Controller.php

Linux 区分大小写,windows 不区分大小写

于 2017-03-29T15:21:21.700 回答