valet: Updating to Valet version 2.8.1 on macOs 10.15.2 with php 7.4 - 504 Gateway Time-out

Valet version : 2.8.1 macOs version: 10.15.2

Error: 504 Gateway Time-out

nginx-error-log Screenshot 2020-01-22 at 00 28 49

Contents of /usr/local/etc/php/7.4/php-fpm.d/valet-fpm.conf

; FPM pool configuration for Valet

[valet]
user = neerav
group = staff
listen = /Users/neerav/.config/valet/valet.sock
listen.owner = neerav
listen.group = staff
listen.mode = 0777

;; When uncommented, the following values will take precedence over settings declared elsewhere
;php_admin_value[memory_limit] = 128M
;php_admin_value[upload_max_filesize] = 128M
;php_admin_value[post_max_size] = 128M

;php_admin_value[error_log] = /Users/neerav/.config/valet/Log/fpm-php.www.log
;php_admin_flag[log_errors] = on



pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

Contents of /usr/local/etc/nginx/nginx.conf

user "neerav" staff;
worker_processes auto;

events {
    worker_connections  1024;
}

http {
    include mime.types;
    default_type  application/octet-stream;

    sendfile on;
    keepalive_timeout  65;
    types_hash_max_size 2048;
    client_max_body_size 128M;

    server_names_hash_bucket_size 128;

    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/neerav/.config/valet/Nginx/*";
    include servers/*;
    include valet/valet.conf;
}

Contents of /usr/local/etc/nginx/valet/valet.conf

server {
    listen 127.0.0.1:80 default_server;
    root /;
    charset utf-8;
    client_max_body_size 128M;

    location /41c270e4-5535-4daa-b23e-c269744c2f45/ {
        internal;
        alias /;
        try_files $uri $uri/;
    }

    location / {
        rewrite ^ "/Users/neerav/.composer/vendor/laravel/valet/server.php" last;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log off;
    error_log "/Users/neerav/.config/valet/Log/nginx-error.log";

    error_page 404 "/Users/neerav/.composer/vendor/laravel/valet/server.php";

    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass "unix:/Users/neerav/.config/valet/valet.sock";
        fastcgi_index "/Users/neerav/.composer/vendor/laravel/valet/server.php";
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME "/Users/neerav/.composer/vendor/laravel/valet/server.php";
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }

    location ~ /\.ht {
        deny all;
    }
}

Output of brew services list Screenshot 2020-01-22 at 00 21 57

php --ini Screenshot 2020-01-22 at 00 35 35

Things broke when I tried to upgrade PHP from 7.3.11 to 7.4.

What I have tried so far

valet uninstall --force

brew services restart --all

brew uninstall php
brew install php

composer global update
valet install

Reboot the computer.

Nothing works - still getting 504 Gateway Time-out error

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 50 (24 by maintainers)

Most upvoted comments

Thank you very much for your help. I really appreciate the efforts to guide me through - wouldn’t have been possible for me to do on my own without trying for hours googling and probably messing up my system as well.

I’m closing this issue now.

@drbyte Thanks for giving the https://github.com/laravel/valet/issues/861#issuecomment-562099906

This solves the SQLSTATE[HY000] [2006] MySQL server has gone away error by creating /usr/local/opt/mysql/my.cnf file and adding the following in the file


[mysqld]
default_authentication_plugin=mysql_native_password

Finally things are back to working - with latest versions of valet: 2.8.1 php: 7.4.1 and mysql: 8.0.19