Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/jquery-mobile/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在本地主机上设置CakePhp_Cakephp - Fatal编程技术网

在本地主机上设置CakePhp

在本地主机上设置CakePhp,cakephp,Cakephp,我已经“内置”了一个CakePHP网站。我已将sites文件夹拖放到本地主机中,并设置了数据库配置。它似乎正在加载视图,但是没有加载.css和图像,例如链接直接指向localhost localhost/categorys 而不是 localhost/mysite/categorys 是否需要设置配置以确保所有内容都指向正确的位置?在app/webroot目录中配置index.php文件 向下滚动至显示以下内容的部分: /** * The full path to the director

我已经“内置”了一个CakePHP网站。我已将sites文件夹拖放到本地主机中,并设置了数据库配置。它似乎正在加载视图,但是没有加载.css和图像,例如链接直接指向localhost

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

并确保路径指向评论应该指向的位置。

查看服务器日志了吗?谢谢。我只是把它放在本地主机的根上。