Today, I started getting a 502 Bad Gateway error in a Laravel app I am working on. After hours of research and combing through my codebase I see that php-fpm is not working correctly with Laravel Valet.
The 502 Bad Gateway error happens on registration in the Laravel app.
In the php-fpm.log I see the following message:
[09-Jul-2019 16:38:42] ERROR: Another FPM instance seems to already listen on /Users/daniel/.config/valet/valet.sock
[09-Jul-2019 16:38:42] ERROR: FPM initialization failed
I have tried uninstalling php, nginx, and valet numerous times. Tried different versions of php from 5.6 to 7.3. Restarted my macbook multiple times. Cleared the cache in my browser. Tried a different browser. Nothing seems to be fixing it.
Here is my nginx.conf:
user "daniel" staff;
worker_processes auto;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
client_max_body_size 128M;
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
ssi on;
gzip_types
application/atom+xml
application/javascript
application/json
application/rss+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-web-app-manifest+json
application/xhtml+xml
application/xml
font/opentype
image/svg+xml
image/x-icon
text/css
text/plain
text/x-component;
include "/Users/daniel/.config/valet/Nginx/*";
include servers/*;
include valet/valet.conf;
}
Anyone have any other suggestions for fixing this? My last resort is doing a complete rebuild of my macbook, but I would rather not if I can help it.
Thanks!