Symfony1 symfony错误索引并自动重定向到xampp网页

Symfony1 symfony错误索引并自动重定向到xampp网页,symfony1,xampp,redirect,Symfony1,Xampp,Redirect,我安装了xampp,它与我的symfony配合得非常好。我甚至在项目上做了一些练习。 然而,我无法设置我的最新项目,这是从另一台电脑复制 外观:在中打开的站点看起来不错,但是当我制作symfony cc(以防万一)然后在中打开时,页面将重定向到xampp主页 我使用symfony1.4 有前端和后端文件夹。我只在前端文件夹中工作。 我认为任何文件都会把事情搞得一团糟,但我不知道。 请帮忙 xamp apache: # # Virtual Hosts # # If you want to main

我安装了xampp,它与我的symfony配合得非常好。我甚至在项目上做了一些练习。 然而,我无法设置我的最新项目,这是从另一台电脑复制

外观:在

中打开的站点看起来不错,但是当我制作symfony cc

(以防万一)然后在

中打开时,页面将重定向到xampp主页

我使用symfony1.4 有前端和后端文件夹。我只在前端文件夹中工作。 我认为任何文件都会把事情搞得一团糟,但我不知道。 请帮忙

xamp apache:

#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
##NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#
##<VirtualHost *:80>
    ##ServerAdmin postmaster@dummy-host.localhost
    ##DocumentRoot "C:/xampp/htdocs/dummy-host.localhost"
    ##ServerName dummy-host.localhost
    ##ServerAlias www.dummy-host.localhost
    ##ErrorLog "logs/dummy-host.localhost-error.log"
    ##CustomLog "logs/dummy-host.localhost-access.log" combined
##</VirtualHost>

##<VirtualHost *:80>
    ##ServerAdmin postmaster@dummy-host2.localhost
    ##DocumentRoot "C:/xampp/htdocs/dummy-host2.localhost"
    ##ServerName dummy-host2.localhost
    ##ServerAlias www.dummy-host2.localhost
    ##ErrorLog "logs/dummy-host2.localhost-error.log"
    ##CustomLog "logs/dummy-host2.localhost-access.log" combined
##</VirtualHost>
我正在使用netbeans7和已安装的插件:php+symfony


edit1:我把路径从我的项目改成了真实的我的路径。。。

在frontend_dev打开的首页中,我可以看到indexSuccess中的文本:

但如果我点击任何链接,它会显示:


我是如何解决的: 1将此目录更改为较短的目录,然后放入另一个目录。C:\www 2在这个文件夹中,我放置了项目中的所有文件:应用程序、缓存等(如果您没有文件“symfony”,您应该创建它,这样symfony就会知道这是symfony目录项目) 3 c:\Windows\System32\drivers\etc\hosts我只放了一个符号:127.0.0.1localhost.tld 4在apache:C:\xampp\apache\conf\extra\httpd vhost中,我输入: NameVirtualHost 127.0.0.1:80

<VirtualHost 127.0.0.1:80>
 ServerName localhost.tld
 DocumentRoot "C:\www\web"
 DirectoryIndex index.php
 <Directory "C:\www\web">
 AllowOverride All
 Allow from All
 </Directory>
</VirtualHost>

ServerName localhost.tld
DocumentRoot“C:\www\web”
DirectoryIndex.php
允许超越所有
通融

5在netbeans>properties of my project>run configuration>project url>中,我写道:

在我看来,文件夹似乎有点混乱

frontend_dev.php应该位于web/目录中

如果localhost/myproject/project1/frontend_dev.php正在工作,那么生产版本应该可以在以下位置访问:


路径中的localhost/myproject/project1/index.php

显示源代码(所有文件)。若我放置/index.php,它会说找不到对象,因为索引在web文件夹中,对吗?工作完美,但当我点击任何链接(例如我实现了action executeBut并在butSuccess:test中写入文本)后,页面显示404对象未找到。在frontpage中显示的action executeIndex中,我可以看到“测试”文本。怎么了?@Michal Mokrzycki你能再做一次编辑来显示你用来显示不起作用的链接的代码吗?我发现了错误,我必须在apache中用特定的虚拟主机配置vhost:
<VirtualHost 127.0.0.1:80>
 ServerName localhost.tld
 DocumentRoot "C:\www\web"
 DirectoryIndex index.php
 <Directory "C:\www\web">
 AllowOverride All
 Allow from All
 </Directory>
</VirtualHost>