【问题标题】:Fatal error: Can't find core file. CakePHP致命错误:找不到核心文件。 CakePHP
【发布时间】:2016-05-24 08:20:40
【问题描述】:

在迁移到 CakePHP 2.0 后,我将它上传到我的服务器并得到了这些令人毛骨悚然的错误。

警告:包含(/home/content/32/11382832/html/shafiullah/hs/app/Config/core.php)[function.include]:无法打开流:/home/ 中没有这样的文件或目录第 75 行的 content/32/11382832/html/shafiullah/hs/lib/Cake/Core/Configure.php

警告:include() [function.include]:无法打开“/home/content/32/11382832/html/shafiullah/hs/app/Config/core.php”以包含(include_path='/home/content /32/11382832/html/shafiullah/hs/lib:.:/usr/local/php5_3/lib/php') 在 /home/content/32/11382832/html/shafiullah/hs/lib/Cake/Core/Configure .php 在第 75 行

致命错误:找不到应用程序核心文件。请创建 /home/content/32/11382832/html/shafiullah/hs/app/Config/core.php,并确保它可以被 PHP 读取。在 /home/content/32/11382832/html/shafiullah/hs/lib/Cake/Core/Configure.php 第 76 行

【问题讨论】:

    标签: cakephp-2.0


    【解决方案1】:

    在您的webroot/index.php

    //some code ... 
    define('CAKE_CORE_INCLUDE_PATH', ROOT);
    //some code ... 
    
    if (!defined('CAKE_CORE_INCLUDE_PATH')) {
        if (function_exists('ini_set')) {
            ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));
        }
        if (!include(ROOT.DS.APP_DIR.DS.'Cake' . DS . 'bootstrap.php')) {
            $failed = true;
        }
    } else {
        if (!include(CAKE_CORE_INCLUDE_PATH . DS . 'lib/Cake' . DS . 'bootstrap.php')) {
            $failed = true;
        }
    }
    

    并将您的视图重命名为“View”,将布局重命名为“Layouts”,将配置重命名为“Config”

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-02
      • 2015-01-20
      • 2014-12-21
      • 2013-12-10
      • 1970-01-01
      相关资源
      最近更新 更多