Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel homestead 502 bad gateway

Everytime i go to my project I get a 502 bad gateway. When I refresh, the page works.. If I click a link to another page I get 502 bad gateway again. After the refresh the page loads. What could be the problem here.

Homestead.yaml

---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: c:/Users/MyNameHere/.ssh/id_rsa.pub

keys:
    - c:/Users/MyNameHere/.ssh/id_rsa

folders:
    - map: c:/Users/MyNameHere/Desktop/sites
      to: /home/vagrant/code

sites:
    - map: spa.test
      to: /home/vagrant/code/spa/public

databases:
    - homestead

Got the latest version for virtualbox and vagrant.

My spa folder contains the newest version laravel.

like image 278
twoam Avatar asked Jan 27 '19 12:01

twoam


People also ask

Does 502 Bad gateway get fixed?

If the error persists, there is a chance that your browser cache has saved outdated and corrupted files. In this case, clearing the browser cache can fix an HTTP 502 Bad Gateway error. Keep in mind that removing cached files might risk you losing important browser data, including bookmarks and setting preferences.

How do I fix 502 bad gateway in Chrome?

What are the major ways to Fix: the 502 Bad Gateway Error in Chrome? The major ways to Fix: the 502 Bad Gateway Error in Chrome are identifying and Removing Extensions via Incognito Mode, Check Website Server Status, Clear Browser Cache and Cookies, and Clear DNS Cache, and Change Network DNS Addresses.

What is laravel Homestead?

Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, a web server, and any other server software on your local machine. Vagrant provides a simple, elegant way to manage and provision Virtual Machines.


1 Answers

Login to Laravel Homestead Server with PuTTY and Private Key File.

then...

cd /etc/php/7.4/mods-available 

sudo nano xdebug.ini

Comment out the first line

;zend_extension=xdebug.so
xdebug.remote_enable = 0
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 512

Then restart PHP-FPM

sudo service php7.4-fpm restart
like image 196
Fabiano Monteiro Avatar answered Sep 22 '22 23:09

Fabiano Monteiro