在本地主机上设置CakePhp
我已经“内置”了一个CakePHP网站。我已将sites文件夹拖放到本地主机中,并设置了数据库配置。它似乎正在加载视图,但是没有加载.css和图像,例如链接直接指向localhost在本地主机上设置CakePhp,cakephp,Cakephp,我已经“内置”了一个CakePHP网站。我已将sites文件夹拖放到本地主机中,并设置了数据库配置。它似乎正在加载视图,但是没有加载.css和图像,例如链接直接指向localhost localhost/categorys 而不是 localhost/mysite/categorys 是否需要设置配置以确保所有内容都指向正确的位置?在app/webroot目录中配置index.php文件 向下滚动至显示以下内容的部分: /** * The full path to the director
localhost/categorys
而不是
localhost/mysite/categorys
是否需要设置配置以确保所有内容都指向正确的位置?在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);
}
并确保路径指向评论应该指向的位置。查看服务器日志了吗?谢谢。我只是把它放在本地主机的根上。