cakephp:致命错误:在共享webhost justhost.com上配置cakephp时找不到core.php

时间:2012-01-23 00:42:37

标签: cakephp configuration shared host

我已按照cakephp cookbook中的生产服务器安装和高级安装中的说明上传了我的网站(到justhost.com)。我也遵循了我之前发布的cakephp中给出的指导:在共享主机justhost上配置cakephp。我已将配置文件夹从app移动到webroot。但是,我仍然得到:

Warning: include(/home/aquinto1/public_html/merryflowers.com/config/core.php) 

[function.include]: failed to open stream: No such file or directory in /home/aquinto1/cake/libs/configure.php on line 400

Warning: include() [function.include]: Failed opening '/home/aquinto1/public_html/merryflowers.com/config/core.php' for inclusion (include_path='/home/aquinto1:/home/aquinto1/public_html/merryflowers.com/:.:/usr/lib/php:/usr/local/lib/php') in /home/aquinto1/cake/libs/configure.php on line 400

Fatal error: Can't find application core file. Please create /home/aquinto1/public_html/merryflowers.com/config/core.php, and make sure it is readable by PHP. in /home/aquinto1/cake/libs/configure.php on line 401

有人可以指出我正在犯的错误。谢谢。

2 个答案:

答案 0 :(得分:1)

如果您移动Cake文件夹,那么您必须更新web root / index.php并告诉它在哪里找到lib目录。这些步骤在1.3和2.0+之间略有不同,所以我在这里假设2.0。

打开webroot / index.php并找到define('CAKE_CORE_INCLUDE_PATH', ROOT . DS . 'lib');。取消注释并将ROOT . DS . 'lib'更改为webroot下的lib文件夹的路径。它可能看起来像这样:

define('CAKE_CORE_INCLUDE_PATH', dirname(__FILE__) . DS . 'lib');

这告诉cake在app / webroot中查找lib文件夹。

这就是说,不要将lib文件夹放在web根目录中,因为它可以通过Web访问。将其放在app文件夹中,并确保包含路径指向正确的目录。

答案 1 :(得分:0)

正如dhofstet所说,我只把webroot的内容放在/public_html/merryflowers.com /.

我在/public_html/merryflowers.com/中编辑了index.php,如下所示:

/**
 * The full path to the directory which holds "app", WITHOUT a trailing DS.
 *
 */

if (!defined('ROOT')) {
    define('ROOT', DS.'home'.DS.'aquinto1');  
    //define('ROOT', dirname(dirname(dirname(__FILE__))));
}
/**
 * The actual directory name for the "app".
 *
 */
if (!defined('APP_DIR')) {
    define('APP_DIR','app');
    //define('APP_DIR', basename(dirname(dirname(__FILE__))));
}
/**
 * The absolute path to the "cake" directory, WITHOUT a trailing DS.
 *
 */

if (!defined('CAKE_CORE_INCLUDE_PATH')) {
    //define('CAKE_CORE_INCLUDE_PATH', ROOT);
    define('CAKE_CORE_INCLUDE_PATH', DS.'home'.DS.'aquinto1');

}

网站的静态页面现在正在显示! :)

Scott Harwell,我正在使用cakephp 1.3。

谢谢大家的指导。你们真是太棒了! :)