Symfony2 在 Apache 上安装演示/配置 404 错误
我正在尝试按照他们网站上的指南设置 Symfony2。我在本地 Ubuntu 机器上运行 Apache2。
中提到的所有错误
我已经设法解决了localhost/Symfony/web/config.php
(按预期工作),但是当我尝试从那里跟踪任一链接时:
localhost/Symfony/web/app_dev.php/ _configurator/ 或 localhost/Symfony/web/app_dev.php/
我收到 404 错误。如果我转到
localhost/Symfony/web/app_dev.php
那么该页面可以工作,但话又说回来,它的所有链接都被破坏了。这可能是 Apache 配置问题吗?
I'm trying to set up Symfony2 as per the guide on their website. I'm running Apache2 on my local Ubuntu machine.
I have managed to resolve all of the errors mentioned in
localhost/Symfony/web/config.php
(which works as expected), but when I try to follow either of the links from there:
localhost/Symfony/web/app_dev.php/_configurator/ or localhost/Symfony/web/app_dev.php/
I get a 404 error. If I go instead to
localhost/Symfony/web/app_dev.php
then the page works, but then again, all links from it are broken. Could this be an Apache config issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您的 apache 文档根目录应该指向 symfony 的 Web 目录
如果我假设以下是 php 文件的路径,
:您应该将 apaches 文档根目录指向:
确保 apaches 重写引擎已打开并且 htaccess 文件被正确读取。
启用 apaches 重写引擎:
如果这没有帮助,请尝试将您的问题添加/移动到 stackoverflow.com,它更多的是 symfony 特定问题,在那里您可以找到更多 symfony 用户。
https://stackoverflow.com/questions/tagged/symfony-2.0
your document root of your apache should point to the web directory of symfony
if i assume the following is the path to the php file:
you should point your apaches document root to:
ensure apaches rewrite engine is on and htaccess files are correctly read.
enable apaches rewrite engine:
if this doesn't help, try adding/moving your question to stackoverflow.com, its more a symfony specific question, there you find more symfony user.
https://stackoverflow.com/questions/tagged/symfony-2.0
您需要将 AcceptPathInfo 指令添加到 .htaccess 或虚拟主机中:
http ://httpd.apache.org/docs/2.0/mod/core.html#acceptpathinfo
这是 Symfony 安装/配置指南中的一个奇怪的疏忽。似乎这个问题已经被人们知道很长时间了然而,解决方案尚未在官方任何地方集成/记录。
You will need to add the AcceptPathInfo directive to your .htaccess or your vhost:
http://httpd.apache.org/docs/2.0/mod/core.html#acceptpathinfo
This is a strange oversight in the Symfony installation / configuration guide.. It seems that the issue has been known about for a long while and yet a solution hasn't been integrated/document anywhere official.