2011-12-14 178 views
0

我有一个CakePHP站点“inheirted”。我已将网站文件夹放入本地主机并设置数据库配置。它似乎正在加载视图,但.css和图像未被加载,并且链接直接指向本地主机。设置本地主机上的CakePhp

localhost/categorys 

而不是

localhost/mysite/categorys 

是否有一个配置,我需要设置,以确保一切指向正确?

+0

你看过服务器日志吗? – 2011-12-14 23:40:02

+0

不,我没有看过他们 – james 2011-12-14 23:41:41

回答

0

在你的app/webroot目录中配置你的index.php文件。

滚动到说,部分:

/** 
* The full path to the directory which holds "app", WITHOUT a trailing DS. 
* 
*/ 
    if (!defined('ROOT')) { 
     define('ROOT', dirname(dirname(dirname(__FILE__)))); 
    } 
/** 
* The actual directory name for the "app". 
* 
*/ 
    if (!defined('APP_DIR')) { 
     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); 
    } 

,并确保路径指向地方的评论说,他们应该指向。