Php 错误\u ICANN\u名称\u使用url而不是ip与主机文件发生冲突

Php 错误\u ICANN\u名称\u使用url而不是ip与主机文件发生冲突,php,laravel,vagrant,homestead,hosts,Php,Laravel,Vagrant,Homestead,Hosts,我试图使用Larvel homestead并将“homestade.dev”重定向到“192.168.10.10”。我可以看到网站使用的IP,但不是“homestead.dev” 我得到这个错误: ERR_ICANN_NAME_COLLISION Pinging homestead.dev以127.0.53.53响应。 我也可以通过以下方式访问网站: 我的家园。亚马尔: ip: "192.168.10.10" memory: 2048 cpus: 1 provider: virtualbox

我试图使用Larvel homestead并将“homestade.dev”重定向到“192.168.10.10”。我可以看到网站使用的IP,但不是“homestead.dev”

我得到这个错误:

ERR_ICANN_NAME_COLLISION
Pinging homestead.dev以127.0.53.53响应。 我也可以通过以下方式访问网站:

我的家园。亚马尔:

ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Code
      to: /home/vagrant/Code

sites:
    - map: homestead.dev
      to: /home/vagrant/Code/myApp/public

databases:
    - myApp

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp
主机文件:

# 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
192.168.10.10   homestead.dev

看起来像名称冲突,请尝试使用不同的名称,例如
myapp.dev

此外,您还可以尝试将其添加到
主机
文件中:

127.0.53.53  homestead.dev
然后在浏览器中使用
homestad.dev:8000


然后再重新启动电脑。

我终于解决了这个问题。问题是主机文件。此帖子帮助我修复了它:


更改主机文件时,我没有复制和替换,而是移动和替换了它,因此权限发生了更改。

尝试了您提到的所有操作,但仍然出现相同的错误:/n如果我在主机中使用
192.168.10.10 myapp.local
,我会遇到以下错误:
ERR\u NAME\u NOT\u RESOLVED
之后您重新启动了计算机吗?您确定已将更改保存在主机文件中吗?在某些Windows版本上,有时看起来您保存了一个主机文件,但当您重新打开该文件时,可以看到更改未保存。当您在浏览器中使用192.168.10.10时,是否看到Laravel起始页?是的,我看到起始页使用192.168.10.10。另外,我确信它被更改了,我关闭了防病毒软件来更改它,并重新打开了文件。好的,你是在使用
myapp.local
还是
myapp.local:8000
?如果我在主机中使用
192.168.10.10 myapp.local
,我会得到这个错误:
ERR\u NAME\u NOT\u RESOLVED