valet: Valet not working as expected, browser not loading any of my projects
So, I make clear installation of valet. When I list brew services list
I get:
Name Status User Plist
php71 started root /Library/LaunchDaemons/homebrew.mxcl.php71.plist
nginx started root /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
dnsmasq started root /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
So I supposed that everything will work correctly but it`s not. Mac Os High Sierra 10.13.2. Valet domain is app, valet config.json is:
{
"domain": "app",
"paths": [
"/Users/macbook/.valet/Sites",
"/Users/macbook/laravel"
]
}
In my laravel folder all my local projects. I will provide any additional information if needed. Any ideas what is wrong with this?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 27 (7 by maintainers)
We just encountered and resolved a similar issue. We changed the domain to a temporary one then back again which seemed to fix the DNS problems by recreating the resolver and the dnsmasq.conf files. EG:
IDK how, but after I change
valet domain
totest
everything start to work ok, thanks a lot for the answers!!!for me was a issue:
sudo /usr/local/opt/nginx/bin/nginx -t nginx: [emerg] open() "/usr/local/etc/nginx/valet/elasticsearch.conf" failed (2: No such file or directory) in /usr/local/etc/nginx/nginx.conf:44 nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed
( elastic was installed ), i created file manualy and worksSorry need quotes there, my mistake:
sudo /usr/local/opt/nginx/bin/nginx -g 'daemon off;'
You need to secure each project, not the parked directory. Super annoying, so unless you have a really good reason for using HTTPS locally, I would just switch to a different TLD, like
.test
which is our new default.To clean things up I would run:
Then if you’ve now got nginx working, try visit one of your projects at
my-project.test/
.Ok looks like nginx isn’t running.
Can you try running:
sudo /usr/local/opt/nginx/bin/nginx -t
and seeing if it shows any errors?
If not, run:
sudo /usr/local/opt/nginx/bin/nginx -g daemon off;
…to try and start nginx manually and seeing if it complains.
Can you create that file and try to visit a site again and see if that log updates with more errors? It shouldn’t need to be created but maybe the entire
Log
folder is missing.More questions:
~/.valet
?macbook
, do you have multiple user accounts on your machine? Valet has a lot of issues in those situations that we haven’t had time to explore. If this is your problem, it’s likely that some username references are incorrect in some generated files. Start with/usr/local/etc/nginx/nginx.conf
and see if any of the username references are for the wrong user.php-fpm
running? (Don’t trust what Homebrew says.) Runps aux | grep php
and paste the output here.dnsmasq
running? (Don’t trust what Homebrew says.) Runps aux | grep dnsmasq
and paste the output here.nginx
running? (Don’t trust what Homebrew says.) Runps aux | grep nginx
and paste the output here.Also had similar struggling after updating valet (to 2.4.2).
Running sudo /usr/local/opt/nginx/bin/nginx -t revealed the real problem
Old version of nginx and missing http2_push_preload. Update nginx and all now everything is working as expected