CakePHP,为域名创建虚拟主机后出现子文件夹问题

发布于 2024-09-14 01:40:14 字数 590 浏览 4 评论 0原文

我最初将 cakephp 安装在 localhost 文件夹的子文件夹中(因此在 Linux 中,我的 localhost 设置为:

/var/www

并且我将 cakephp 安装到:

/var/www/site1

我一直在这个地址使用它,所以: http://localhost/site1

但现在我把它作为一个实时站点,并使用 apache 创建了一个虚拟服务器,所以现在它直接进入 /site1 文件夹:

http://mydomainname.com/

现在我无法访问我的 cakephp 网站,它似乎仍然认为它应该位于“site1”文件夹中,我不记得最初做了任何事情来告诉它位于 /site1 文件夹中,例如设置任何内容,但它是不久前,我记不清了。我正在调查这个问题,它告诉我到目前为止该信息可能位于的地方没有显示任何指示子文件夹的信息。如果有人有的话,我将不胜感激关于做什么的想法

谢谢。

I originally installed my cakephp in a subfolder of my localhost folder (so in linux my localhost is set to:

/var/www

and I installed cakephp to:

/var/www/site1

I had been using it at this address, so: http://localhost/site1

But now I am putting it up as a live site and I made a virtual server with apache so now this goes directly to the /site1 folder:

http://mydomainname.com/

Now I cannot access my cakephp site, it still seems to think it should be in the "site1" folder, I don't recall doing anything initially to tell it to be in the /site1 folder, such as setting anything, but it was a while ago and I can't remember exactly.. I am looking into this and the places it has told me to look so far where this info might be located is not showing anything indicating the subfolder.. I would greatly appreciate if anyone has ideas on what to do.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

錯遇了你 2024-09-21 01:40:14

检查并确保 .htaccess 文件已复制到正确的文件夹中。如果您还没有复制它们,请检查它们是否存在。

检查您的 app/config/core.phpapp/config/routes.php 以确保其中没有任何特定于路径的内容。

检查您的 Apache 虚拟主机配置,确保文档根目录指向您安装 cake 的文件夹。例如 /site 而不是 site1/app/webroot 或类似的内容那。

事后诸葛亮,
检查您的 Apache 配置以确保您允许本地 htaccess 覆盖设置。还要确保您的服务器上启用了 mod_rewrite

另外,请务必检查完整的安装说明,因为您可能错过了一些可能会导致问题的小事情。 http://book.cakephp.org/view/907/Developing-with- CakePHP

Check to make sure that the .htaccess files have been copied into the right folders. If you haven't copied them, check they are there anyway.

Check over your app/config/core.php and app/config/routes.php to ensure that you don't have any path specific things in there.

Check your Apache vhost config to ensure that the document root is pointing to the folder you installed cake in. Such as /site and NOT to site1/app/webroot or anything like that.

Afterthought,
Check your Apache config to ensure that you are allowing local htaccess to override settings. And also make sure that mod_rewrite is enabled on your server.

Also be sure to check over the full installation instructions, as there might be a tiny thing that you've missed which could contribute to your issue. http://book.cakephp.org/view/907/Developing-with-CakePHP

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文