【发布时间】:2011-06-03 16:45:51
【问题描述】:
我安装了 xampp,它在我的 symfony 上运行良好。我什至在项目上做了一些练习。 但是我无法设置从另一台 PC 复制的最新项目。
它看起来如何:网站在
中打开http://localhost/ppz/chujwiecotobedzie/web/frontend_dev.php
看起来不错,但是当我制作symfony cc
(以防万一)然后在http://localhost/ppz/chujwiecotobedzie/web/
中打开时,页面将重定向到 xampp主页。我使用 symfony 1.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>
Windows 主机:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost
我正在使用带有已安装插件的 netbeans 7:php + symfony
edit1:我将路径从 myproject 更改为真正的路径 chu...
在 frontend_dev 打开的首页中,我可以看到 indexSuccess 中的文本:
但是,如果我单击任何链接,它会显示:
我是如何解决的: 1 将此目录更改为更短并放入另一个目录。 C:\www
2 在这个文件夹中,我把项目中的所有文件:应用程序、缓存等(如果你没有文件 'symfony' 你应该这样做,这样 symfony 会知道这是 symfony 目录项目)
3 c:\Windows\System32\drivers\etc\hosts 我只放了一个标志:127.0.0.1 localhost.tld
4 在 apache:C:\xampp\apache\conf\extra\ httpd vhost 我放: 名称VirtualHost 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>
netbeans 中的 5> 我的项目的属性 > 运行配置 > 项目 url > 我写道:http://localhost.ltd/
【问题讨论】: