Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

filljoyner's avatar

Valet not resolving sites on a fresh install of macOS

Hi all,

I didn't want to start another Valet thread but I just can't get this to work. This is a fresh install of macOS so here's what has been installed so far

  • composer (configured paths - "composer" in terminal works)
  • laravel installer (configured composer bin to resolve)
  • blog ("laravel new blog" to confirm the above is working)
  • homebrew
  • php7.1 via homebrew
  • mysql via homebrew

I should now be good to get Valet up and running:

  • Installed Valet globally through composer
  • Valet installed nginx and dnsmasq through homebrew
  • valet install, all good
  • went over to parent folder "blog" is in (~/Sites), valet park

I tried the URL (http://blog.dev) and it didn't resolve. Pinged the URL and nada, Checked Activity Monitor and Dnsmasq and Nginx were not running. Started those manually through Homebrew. Tried again. Not working, not even a ping.

After a series of uninstalling all the services manually, uninstalling valet, deleting the .valet folder in the home directory, reinstall, not working, no resolves, check http://localhost & http://localhost:8080 (not resolving), confirming apache was not running but nothing seems to work.

Any ideas where the issue may be or how I might continue to troubleshoot?

0 likes
14 replies
ejdelmonico's avatar

Try running brew services list to check that nginx, php71 and dnsmasq are started. Also, post you ~/.valet/config.json contents.

Also, there is a Log directory that you could check for clues.

1 like
filljoyner's avatar

Thanks so much for the reply!

When running brew services list it shows that dnsmasq, mysql, nginx, php71 are all "started."

config.json

{
    "domain": "dev",
    "paths": [
        "/Users/filljoyner/Sites"
    ]
}

I checked the "Log" folder in .valet and it contained a single empty file "nginx-error.log."

ejdelmonico's avatar

Did you see anything of interest in the nginx-error.log? Eventually, you will have an error.log and an access.log file as well.

What is in you dnsmasq.conf file? It should have one line like address=/.app/127.0.0.1....yours may have .dev in the middle

Check and make sure you have a reference to valet.sock as well. Permissions should be 777.

1 like
filljoyner's avatar

Thanks for the response. The nginx-error.log file is blank. I've tried pinging blog.dev and visiting the URL hoping something would pop in there but still nothing.

The dnsmasq.conf file has the following

address=/.dev/127.0.0.1

I changed the permissions to valet.sock to 777 and tried to open it in vim but getting "Permission Denied." Guessing that is because it is reference.

I really appreciate the help. Any other thoughts?

ejdelmonico's avatar

Valet code uses a switch to sudo before running commands. There shouldn't be anything in the socket file. The perms column in terminal should look like srwxrwxrwx. My terminal looks like this: https://cl.ly/iwRt

Everything seems to be good. You don't have something like MAMP installed do you?

1 like
filljoyner's avatar

From your screenshot our .valet directories are identical. Same folders, files and permissions.

No MAMP or any other server apps installed. I start with a system wipe, installed Chrome, Node and Yarn before moving on to Laravel and Valet so it doesn't have much on it at all.

I wanted to move away from Homestead because it is a resource hog but that might not be possible if my Mac and Valet don't get along.

The machine is a late 2012 Macbook Pro but I doubt Valet would have issues with hardware.

This is a strange one.

ejdelmonico's avatar

I doubt that the machine is the problem. I use Homestead for larger sites and Valet for quick stuff. I have both working without a hitch on my macbook pro late-2014. It must be something strange on an install. It could be a permissions issue with all the installs. Most of the Homebrew installs should be 755. Also, check everything in /usr/local/Cellar for 755 perms.

1 like
filljoyner's avatar

Everything in Cellar is 755. My account is the owner and the group is "admin" instead of "staff." Is that ok?

filljoyner's avatar

The only thing I can think of, and don't know how I'd check, is if at some point in the installation, I used "sudo" when I shouldn't have. I usually only do this when something requires escalated permissions. I've uninstalled and reinstalled several times so I don't think I would have made that mistake multiple times.

ejdelmonico's avatar

Yep, if you mistakingly used sudo in one of the installs, that would do it. the install would then take on the privileges of beyond your user. However, if you checked all of the perms, That probably isn't the issue. Maybe review again checking for the owner and group as well.

All of the valet stuff should be your user and staff. /usr/local should be 777 and You and staff...all others should be root and wheel. Everything in /usr/local should be you and staff. Make sure you are the owner of composer. If you aren't then change it to you and staff, uninstall valet and install again.

assoft's avatar

Always show "it works"

Pls help me

Where do i make mistakes..

➜  .valet cat config.json
{
    "domain": "dev",
    "paths": [
        "/Users/assoft/.valet/Sites",
        "/Users/assoft/Code"
    ]
}
➜  .valet cat dnsmasq.conf
address=/.dev/127.0.0.1
➜  .valet sudo lsof -n -i:80 | grep LISTEN
Password:
httpd   63671 root    4u  IPv6 0x7886580bdd814c8f    0t0  TCP *:http (LISTEN)
httpd   63676 _www    4u  IPv6 0x7886580bdd814c8f    0t0  TCP *:http (LISTEN)
httpd   63739 _www    4u  IPv6 0x7886580bdd814c8f    0t0  TCP *:http (LISTEN)
httpd   63740 _www    4u  IPv6 0x7886580bdd814c8f    0t0  TCP *:http (LISTEN)
httpd   63741 _www    4u  IPv6 0x7886580bdd814c8f    0t0  TCP *:http (LISTEN)
➜  .valet brew services list
Name    Status  User   Plist
dnsmasq started root   /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
mariadb started Assoft /Users/assoft/Library/LaunchAgents/homebrew.mxcl.mariadb.plist
php70   started root   /Library/LaunchDaemons/homebrew.mxcl.php70.plist
php71   stopped
➜  .valet ping blog.dev
PING blog.dev (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.040 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.165 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.132 ms
^C
--- blog.dev ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.040/0.112/0.165/0.053 ms

.valet files permissions

drwxr-xr-x  10 Assoft  staff   340B  3 Şub 11:22 .
drwxr-xr-x+ 48 Assoft  staff   1,6K  3 Şub 11:32 ..
drwxr-xr-x   3 Assoft  staff   102B  2 Şub 15:18 Drivers
drwxr-xr-x   2 Assoft  staff    68B  2 Şub 15:18 Extensions
drwxr-xr-x   3 Assoft  staff   102B  2 Şub 15:18 Log
drwxr-xr-x   3 Assoft  staff   102B  2 Şub 15:18 Nginx
drwxr-xr-x   3 Assoft  staff   102B  3 Şub 11:16 Sites
-rw-r--r--   1 Assoft  staff   113B  3 Şub 11:23 config.json
-rw-r--r--   1 Assoft  staff    24B  2 Şub 20:34 dnsmasq.conf
srwxrwxrwx   1 Assoft  staff     0B  3 Şub 11:22 valet.sock
ejdelmonico's avatar

First, start by removing the /Users/assoft/.valet/Sites line from ~/.valet/config.json because it is an bad path. If you are using parked paths at Code and Sites, the remove the .valet from the first path. Look up the chain at my posted link to the output of brew services ls and see if you machine produces similar output. Valet listens on port 8080 I believe unless they changed it back to 80.

You should not have to use a .valet command anywhere. Just use valet start or valet stop, etc. Additionally, Valet uses nginx to serve the sites.

assoft's avatar

@ejdelmonico Thank you for your interest

i did... but It was not the solution for me


~ valet links
total 8
drwxr-xr-x   3 Assoft  staff  102  3 Şub 21:24 .
drwxr-xr-x  10 Assoft  staff  340  3 Şub 21:01 ..
lrwxr-xr-x   1 Assoft  staff   24  3 Şub 21:24 haber -> /Users/assoft/Code/haber
➜  ~ valet paths
No paths have been registered.
➜  ~ brew services ls
Name    Status  User  Plist
dnsmasq started root  /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
mariadb started root  /Library/LaunchDaemons/homebrew.mxcl.mariadb.plist
nginx   started root  /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
php70   started root  /Library/LaunchDaemons/homebrew.mxcl.php70.plist
php71   started Admin /Users/assoft/Library/LaunchAgents/homebrew.mxcl.php71.plist
➜  ~ ping foo.dev
PING foo.dev (127.0.0.1): 56 data bytes
64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.035 ms
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.139 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.071 ms

anything.dev result "It Works"

Maybe there is another mistake but I do not know it.

I think I'm having a problem with permissions

➜  .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)
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] still could not bind()
DC Blog's avatar

I was getting this after a reinstall of MacOS doing this in terminal solved it for me:

sudo brew services start --all
1 like

Please or to participate in this conversation.