0

托管 cakephp 应用程序时出现错误:

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

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

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'));

}
4

1 回答 1

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 应该可以开箱即用,我不必修改它。

于 2013-05-29T12:45:51.573 回答