0

I want to develop with Symfony4 on my local machine. But somehow I can't get any good configuration working. At the moment, I believe I've done it the way Symfony suggests.

I don't want to make use of the server component but want to run it on a real server with redis, mysql etc.

I've install Homestead following this topic: https://symfony.com/doc/current/setup/homestead.html

In the Homestead.yaml file I also added the nfs type on the mapped folders so it speeds up the code. See my Homestead.yaml file below:

But when I run the website, the server throws me a 502 Bad Gateway. But if I hit refresh, it might just show me the default page after Symfony is installed. Hitting refresh again, I might be lucky to get the webpage again, but often it shows the 502 Bad Gateway again. So on every refresh it is a surprise to what I get, a 502 or just te page.

Oh, and if I'm not getting a 502, I might be getting a Whoops, looks like something went wrong..

I don't understand anything of this, hopefully someone can help me out.

Homestead.yaml

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

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: ~/Code
      to: /home/vagrant/code
      type: "nfs"

sites:
    - map: blog.symfony.test
      to: /home/vagrant/code/symfony/blog.symfony.nl/public
      type: "symfony4"

databases:
    - homestead
Timo002
  • 3,138
  • 4
  • 40
  • 65
  • Where is your `Symfony` project located? If it's not under `/home/{user}/Code/symfony/blog.symfony.nl` it won't work because your mapping is incorrect. Also, I've read somewhere the advice that says that you should map each project individually, so instead of mapping `~/Code` map `~/Code/symfony/blog.symfony.nl` – domagoj Jan 29 '19 at 15:52
  • @Domagoj, I will try the to do a folders mapping for each project. Why can't the Symfony project not be under the given path? What is wrong with that? – Timo002 Jan 29 '19 at 15:55
  • It can, I don't know if it is. Where did you install your Symfony project? – domagoj Jan 29 '19 at 16:01
  • On the host, because I needed the folder structure bedoel I could mount the folders – Timo002 Jan 29 '19 at 16:04
  • Exactly, but where? `cd` to your symfony project folder, do `pwd` and add the output instead of `~/Code`, for example `map: /home/timo/Projects/symfony/blog.symfony.nl` – domagoj Jan 29 '19 at 16:06
  • Not at the Office anymore, but will try to put in the full path tomorrow morning! – Timo002 Jan 29 '19 at 16:08
  • Sure. When you put in full path, I will post an answer as an entire `Homestead.yaml` – domagoj Jan 29 '19 at 16:09
  • @Domagoj, unfortunately that doesn't change a thing. – Timo002 Jan 30 '19 at 07:07
  • Did you provision? Every time you change `Homestead.yaml` you need to `homestead reload --provision` or `homestead up --provision` depending on virtual machine's status – domagoj Jan 30 '19 at 07:10
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/187543/discussion-between-timo002-and-domagoj). – Timo002 Jan 30 '19 at 07:14
  • Ok, the issue was on xdebug. See this thread: https://stackoverflow.com/a/54373498/1643487 – Timo002 Jan 30 '19 at 09:28

0 Answers0