我最近重新安装了wampserver3 w/php 5.6.16 & php 7
。 Composer
也在全球范围内安装laravel
框架。我重新安装的原因是因为我在localhost上的项目文件夹在访问时会抛出404错误。我已将$suppresslocalhost
编辑为false
无效。我的php错误日志显示:> PHP未定义索引: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>
答案 0 :(得分:1)
正确的解决方案是为每个项目创建一个虚拟主机。
听起来你安装了WAMPServer3。在该版本中,您只需单击按钮即可创建虚拟主机。它为你做了一切!
如果您还没有这样做,请首先创建您要将此网站放入的目录。
如果您喜欢,或者在任何其他文件夹中,该文件夹可以位于\wamp\www\project1\www
下,例如C:\websrc\project1\www
。
查看WAMPServer主页并点击Add a Virtual Host
列下的TOOLS
链接,然后按照简单说明进行操作
WAMPServer将自动重启Apache,以便Apache看到新的虚拟主机。
完成后: -
rightclick wampmanager -> tools -> Restart DNS
您可能还会在wampmanager右键菜单中看到一些其他有用的新功能!