Web主机无法识别本机自动加载

时间:2012-08-20 07:20:56

标签: php codeigniter

我在config.php中添加了以下代码段:

 /*
| -------------------------------------------------------------------
|  Native Autoload - by Phil Sturgeon. New Version!
| -------------------------------------------------------------------
|
| Nothing to do with config/autoload.php, this allows PHP autoload to work
| for base controllers and some third-party libraries.
|
| If using HMVC you do not need this! HMVC will autoload.
|
| Place this code at the bottom of your application/config/config.php file.
*/
function __autoload($class)
{
    if (strpos($class, 'CI_') !== 0)
    {
        if (file_exists($file = APPPATH . 'core/' . $class . 'php'))
        {
            include $file;
        }
        elseif (file_exists($file = APPPATH . 'libraries/' . $class . 'php'))
        {
            include $file;
        }
    }
} 

出于某种原因,我发现我的网站主机出错了;以上代码仅适用于我的localhost xampp!

当我从远程网络主机运行我的页面时,我收到此错误:

Fatal error: Class 'Frontend_Controller' not found in ....***some path***..../ci_centric/application/controllers/home.php on line 16

路径:

  

Frontend_Controller扩展了MY_Controller

     

MY_Controller位于核心,Frontend_Controller驻留在库

中      

家庭控制器扩展了Frontend_Controller

想知道为什么它在我的网络主机中不起作用,但在localhost中工作正常!我需要编辑php.ini吗?请指教。

远程Web主机具有PHP 5.2版。*

0 个答案:

没有答案