I have macOS High Sierra 10.13.6 and I’m running WordPress site locally on Laravel Valet 2.11.0. Yesterday I had some other issues with my local setup which I managed to fix by brew update/upgrade and few other tweaks. Since then everything was running fine until I rebooted the laptop overnight. Now I get an error "502 Bad Gateway nginx/1.19.1” on the frontend.
I believe it’s something to do with PHP not linking correctly but can’t work out what exactly is wrong.
Error in nginx-error.log file:
2020/07/22 22:27:41 [crit] 75400#0: *1 connect() to unix:/Users/klara1/.config/valet/valet.sock failed (2: No such file or directory) while connecting to upstream, client: 127.0.0.1, server: domainname.test, request: "GET /favicon.ico HTTP/2.0", upstream: "fastcgi://unix:/Users/klara1/.config/valet/valet.sock:", host: "domainname.test", referrer: "https://domainname.test/“
brew list | grep php
php
php@7.1
php@7.2
php@7.3
which php
/usr/local/opt/php@7.3/bin/php
php -v 7s
PHP 7.3.20 (cli) (built: Jul 10 2020 00:02:14) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.20, Copyright (c) 1998-2018 Zend Technologies
ps ax | grep php
72830 s000 R+ 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn php
php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/7.3
Loaded Configuration File: (none)
Scan for additional .ini files in: /usr/local/etc/php/7.3/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.3/conf.d/php-memory-limits.ini
When I run sudo brew services restart nginx && sudo brew services restart php73
I get an error at the end:
==> Successfully started `nginx` (label: homebrew.mxcl.nginx)
Error: No available formula with the name "php73"
brew link php73
Error: No such keg: /usr/local/Cellar/php73
brew info php73
Error: No available formula with the name "php73"
==> Searching for a previously deleted formula (in the last month)...
Warning: homebrew/core is shallow clone. To get complete history run:
git -C "$(brew --repo homebrew/core)" fetch --unshallow
Error: No previously deleted formula found.
When running valet stop
it's stopping two different PHP versions:
valet stop
Stopping php...
Stopping php@7.2...
Stopping php@7.3...
Stopping nginx...
Valet services have been stopped.
I have done the following troubleshooting recommended here (https://laracasts.com/discuss/channels/general-discussion/updating-to-php-73):
brew unlink php && brew link php
brew services restart —all
composer global update
valet start
Also:
brew update
brew upgrade php
Also:
valet install
But nothing works… still get the same error. Does anyone know what this could be, please?! Any help is appreciated!