1

Is it possible to run Symfony dev on a virtual machine?

In the config.php it queries the request uri, if not 127.0.0.1 in errors and says it can only be configured on localhost.

How do i get around this?

2 Answers 2

1

There is a good reason for that - config and app_dev are private resources and should only be ran from localhost.

Since you want to run your dev from VM Host (rather than VM Guest) you should just add your interface address to both config.php and app_dev.php.

For example, I have set up VMWare which allocated the address 192.168.78.10 to my VM Guest. My VM Host is at 192.168.78.1 (first address in that network). So you need to add 198.168.78.1 to both of those files.

Sign up to request clarification or add additional context in comments.

1 Comment

ie adding to the array of allowed ip's for the dev environment?
1

Alternatively, you can comment out the line judging the IP (127.0.0.1) in app_dev.php.

Sometimes it is worthy to do so especially when everything is fine in the local env but fails in the actual prod env.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.