502 bad gateway after installation

Hi everyone,

After installation just following instruction on “https://learn.userfrosting.com/installation/environment/homestead”, when I open my test site “userfrosting.test”, I see 502 bad gateway not the “userfrosting page”.

So, I googled and found out https://stackoverflow.com/questions/27173945/homestead-502-bad-gateway-instead-of-whoops-for-php-errors . However it was not for my case.

Any suggestion for this case?

Thanks.

You might want to look at the homestead logs for more details about the specific of this error. Could be anything. But most certainly related to the homestead box.

Hi,

New user here. I just ran into the same problem and it looks like it’s related to PHP 7.3.

Source: https://github.com/laravel/homestead/issues/1031

Everything seems to work if you use PHP 7.2 instead of the default 7.3. Simply add the following line to Homestead.yaml:

sites:
    - map: userfrosting.test
      to: /home/vagrant/userfrosting/public
      php: "7.2"

Since UserFrosting will run on PHP 5.6 or higher it should work as a temporary fix at least, unless you need 7.3 for any other part of your website.

Hope this helps!

Weird. I used Homestead with PHP 7.3 before and everything was fine…

Too busy to study userfrosting!!
Anyway, I check nginx error log file userfrosting.test-error.log in /var/log/nginx.

2019/01/31 06:05:17 [error] 845#845: *3 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.181.1, server: userfrosting.test, request: “GET / HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php/php7.3-fpm.sock:”, host: “userfrosting.test”

I’m still struggling with vagrant settings.

Thanks.

Hi Tom.

It works with php: “7.2” parameter.

When I just put the parameter in already built environment, it still gets the same error.

I deleted all the settings and vagrant and reinstalled from the first step but with php: “7.2” parameter in Homestead.yaml. After installation, I see the userfrosting screen on my browser.

Thanks a lot.

Had the same error and added the php: “7.2” param to Homestead.yaml and it worked like a charm. You just have to remember to re-provision the vagrant instance so it loads the .yaml file again.

Use : vagrant reload --provision