Laravel Valet在安装后无法解析站点 [英] Laravel Valet not resolving sites after install

查看:661
本文介绍了Laravel Valet在安装后无法解析站点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在没有全新安装的代客服务的情况下,经历了极为令人沮丧的时间.转到浏览器中的任何* .test站点都将挂起,并最终显示错误消息This site can’t be reached,"ping app.test"也挂起,并且出现最终错误,并带有"ping:无法解析应用程序".测试:未知主机".但是,对其他域执行ping操作(例如,立即进行ping.xyz错误,而不是在* .test之后约20秒后).

Having a terribly frustrating time not having valet working on a fresh install. Going to any *.test site in my browser just hangs and eventually gets the error message This site can’t be reached, "ping app.test" hangs as well, and eventually errors with "ping: cannot resolve app.test: Unknown host". However pinging a different domain (such as ping.xyz errors immediately, as opposed to after ~20 seconds like with *.test).

在Os Sierra上,我的composer.json如下所示

On Os Sierra, my composer.json looks like the following

{
    "require": {
        "laravel/installer": "^1.5",
        "laravel/valet": "dev-master"
    }
}

因为我已经看到dev-master为某些人解决了此问题.我所有的进程似乎都在运行:

Since I've seen that dev-master resolved this for some people. All my processes seem to be running:

但是,有些线索表明,我的浏览器中的http://localhost/返回了页面404-找不到,而运行sudo nginx则返回了一堆已经存在用户错误的信息:

However some clues are that http://localhost/ in my browser returns a page 404 - not found, and running sudo nginx returns a bunch of already in user errors:

❯ pwd                                                                                                                                                                 
/Users/schorr/.valet

schorr@Andrew-Schorr ~/.valet 
❯ sudo Nginx                                                                                                                                                          
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use)

valet fetch-share-url返回

❯ valet fetch-share-url                                                                                                                                                [17:04:53]
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
Failed to connect to 127.0.0.1 port 4040: Connection refused
...

任何帮助将不胜感激.谢谢!

Any help is greatly appreciated. thanks!

推荐答案

最后弄清楚了这个问题,对于在我特定情况下的其他人而言:

Finally figured this out, for anyone else in my very specific situation:

我已在同一台计算机上更改了用户名,无论出于何种原因,安装dnsmasq都不会覆盖旧的/Users/user/.valet/dnsmasq.conf文件.所以在最底层我有:

I had changed my user name on the same machine, and for whatever reason installing dnsmasq wasn't overwriting the old /Users/user/.valet/dnsmasq.conf file. So at the very bottom I had:

conf-file=/Users/OLD_USER_NAME/.valet/dnsmasq.conf

conf-file=/Users/NEW_USER_NAME/.valet/dnsmasq.conf

因此,我要做的就是注释掉OLD_USER_NAME行,并且很高兴进行以下操作:|

So all I had to do was comment out the OLD_USER_NAME line and was good to go :|

这篇关于Laravel Valet在安装后无法解析站点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆