valet: Error running valet. PHP Notice: Undefined index: domain in valet.php
Hi,
So I’m developing a Laravel + Vue app, and I’m getting to the point where Homestead is a little too slow. I decided to give Valet a go, and haven’t been able to get it off the ground.
Composer Installs successfully, no errors on install whatsoever.
However, when I go to valet install
I get the following:
PHP Notice: Undefined index: domain in /Users/kingsley/.composer/vendor/laravel/valet/cli/Valet/Nginx.php on line 111
Notice: Undefined index: domain in /Users/kingsley/.composer/vendor/laravel/valet/cli/Valet/Nginx.php on line 111
One Laracast forum post mentioned to link or park a domain, so I tried linking my Laravel app, but when I go to visit the URL in the browser I get:
Notice: Undefined index: domain in /Users/kingsley/.composer/vendor/laravel/valet/server.php on line 55
404 - Not Found
I’m not sure what other info may help, but Brew is up-to-date, php -v returns v 7.1.0
I’m not sure if it’s related, but when I run nginx
, I get:
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /usr/local/etc/nginx/nginx.conf:1
nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
Does anyone have any idea? Thanks
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 27 (4 by maintainers)
FIXED.
To anyone else having a similar problem, I’m not sure on the exact issue but I believe it was something to do with Brew, and permissions with nginx and dnsmasq.
Before installing valet, make sure php71, dnsmasq, nginx, are installed and running ok by using brew services:
brew services list
Which should be:
If you see error under any of them, stop all the services by running:
I think I had nginx started under my user account AND under root (2 running instances).
Restart php, nginx, and dnsmasq as root:
Completely remove all valet files in ~/.valet
Then install valet
Hopefully that’ll do the trick!
Nginx can’t bind to port 80 unless it’s run as root, so nothing should work, haha…
I would check
ps aux | grep nginx
and see if it actually is running as your user and not as root.