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

cakephp:致命错误:can';在共享webhost justhost.com上配置cakephp时找不到core.php,cakephp,configuration,shared,host,Cakephp,Configuration,Shared,Host,我已经按照cakephp食谱中的“生产服务器安装和高级安装”中的说明将我的网站(上传到justhost.com)。我还遵循了我上一篇文章《cakephp:在共享主机justhost上配置cakephp》中给出的指导。我已将配置文件夹从app移动到webroot。然而,我仍然得到: Warning: include(/home/aquinto1/public_html/merryflowers.com/config/core.php) [function.include]: failed to

我已经按照cakephp食谱中的“生产服务器安装和高级安装”中的说明将我的网站(上传到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

有人能指出我犯了什么错误吗。谢谢。

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

打开webroot/index.php并找到
define('CAKE\u CORE\u INCLUDE\u PATH',ROOT.DS.lib')。取消对它的注释并更改根目录。Dlib'
指向webroot下lib文件夹的路径。可能是这样的:

define('CAKE_CORE_INCLUDE_PATH', dirname(__FILE__) . DS . 'lib');
这告诉cake在app/webroot中查找lib文件夹


总而言之,不要将lib文件夹放在webroot中,因为这样可以通过web访问。将它放在app文件夹中,并确保include路径指向正确的目录。

正如dhofset所说,我只将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


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

为什么要将配置文件夹移动到webroot?那没有道理,因为有个致命的错误。错误表明core.php不在/home/aquinto1/public_html/merryflowers.com/config/中。我还尝试创建了一个config文件夹,并将core.php移动到../public_html/merryflowers.com/中的该文件夹中,但没有触摸../app/config,但也可以。我仍然遇到与上面问题相同的错误。我还尝试从justhost文件管理器将/app/tmp folder、/app/tmp/cache以及缓存中的所有文件和文件夹(即模型、持久性和视图)的权限设置为777,但也不起作用。我仍然不断收到相同的警告和致命错误。您的core.php文件是否在Cake查找它的位置?此外,如果配置文件夹不可读,将缓存文件夹设置为777也不会有多大帮助。您必须对配置文件夹执行此操作。只有webroot文件夹的内容必须在public_html/merryflowers.com/中,其他所有内容都可以在其他地方。确保相应地调整webroot文件夹中的index.php文件。