【问题标题】:Getting error while hosting a cakephp app托管 cakephp 应用程序时出错
【发布时间】:2013-05-29 12:05:07
【问题描述】:

我在托管 cakephp 应用程序时遇到错误:

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

未能打开 '/home/home/a1808794/a1808794/home/a1808794/app/Config/core.php' 以包含 (include_path='/home/a1808794/lib.:/usr/lib/php:/usr /local/lib/php') 在 /home/a1808794/lib/Cake/Core/Configure.php 第 77 行

index.php

if (!defined('ROOT')) {
    //define('ROOT', dirname(dirname(dirname(__FILE__))));
    define('ROOT', dirname(dirname(dirname(__FILE__))).DS.'home'.DS.'a1808794');
}

/**
 * The actual directory name for the "app".
 *
 */
if (!defined('APP_DIR')) {
    define('APP_DIR', basename(dirname(dirname(__FILE__))).DS.'home'.DS.'a1808794'. DS .'app');
}
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
    if (function_exists('ini_set')) {
    /*ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR .    ini_get('include_path'));*/
    ini_set('include_path','home'. DS . 'a1808794'. DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));

}

【问题讨论】:

  • 你的core.php是否丢失或需要为其设置权限?

标签: cakephp hosting


【解决方案1】:

我不知道你为什么认为有必要修改 index.php 文件并重新设置:

define('ROOT', dirname(dirname(dirname(__FILE__))));

有了这个:

define('ROOT', dirname(dirname(dirname(__FILE__))).DS.'home'.DS.'a1808794');

然后替换这个:

ini_set('include_path', ROOT . DS . 'lib' . PATH_SEPARATOR .    ini_get('include_path'));

有了这个:

ini_set('include_path','home'. DS . 'a1808794'. DS . 'lib' . PATH_SEPARATOR . ini_get('include_path'));

并将应用程序目录设置为:

define('APP_DIR', basename(dirname(dirname(__FILE__))).DS.'home'.DS.'a1808794'. DS .'app');

因为那会破坏包含。您的应用程序现在正在尝试包含 /home/home/a1808794/a1808794/home/a1808794/app/Config/core.php,这显然不是有效路径。恢复原始 index.php 应该可以正常工作。如果没有,请说明导致您首先修改 index.php 的实际问题。 index.php 应该开箱即用,我不必修改它。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-04-30
    • 2017-08-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2010-10-31
    • 2021-10-15
    相关资源
    最近更新 更多