我最近重新安装了wampserver3 w/php 5.6.16 & php 7。Composer也与laravel框架一起全局安装。我重新安装的原因是因为我在localhost上的项目文件夹在访问时会抛出404错误。我已经将$suppresslocalhost编辑为false但无济于事。我的php错误日志显示:> PHP Undefined index: HTTP_USER_AGENT。
我在windows 7 x64上运行。
我可以访问localhost、phpmyadmin、phpinfo。
我可能在这个404错误中有一些不同的东西。如上所述,我已经将$suppresslocalhost修改为false,并将我的.htaccess文件重命名,顺便说一句,这不允许我将其重命名为.htaccess,但这是另一个主题,在我的WAMP根目录中的文件名。
提前谢谢。
编辑:
我的httpd-vhosts.conf文件
<VirtualHost *:80>
ServerName localhost
DocumentRoot e:/wamp64/www/
<Directory "e:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName base4
DocumentRoot e:/wamp64/www/base4/
<Directory "e:/wamp64/www/base4/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>EDIT2:
<VirtualHost *:80>
ServerName localhost
DocumentRoot e:/wamp64/www
<Directory "e:/wamp64/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
<VirtualHost *:80>
ServerName test.dev
DocumentRoot e:/wamp64/www/test.dev
<Directory "e:/wamp64/www/test.dev/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>发布于 2016-01-22 01:59:44
正确的解决方案是为每个项目创建一个虚拟主机。
听起来你已经安装了WAMPServer3。在该版本中,您只需单击一个按钮即可创建虚拟主机。它为你做了所有的事情!
首先,如果您尚未创建要放入此站点的目录,请先创建该目录。
如果您愿意,该文件夹可以位于\wamp\www\project1\www下,也可以位于任何其他文件夹中,例如C:\websrc\project1\www。
查看WAMPServer主页,单击TOOLS列下的Add a Virtual Host链接,然后按照简单的说明操作
WAMPServer将自动重启Apache,以便Apache可以看到新的虚拟主机。
一旦它完成了:-
rightclick wampmanager -> tools -> Restart DNS您可能还会在wampmanager右键单击菜单中看到其他一些有用的新功能!
https://stackoverflow.com/questions/34928337
复制相似问题