Important points while using Homestead

While working at the University, I got a chance to explore PHP-Laravel with Homestead as a virtual machine. It was the first time I was working with Homestead as a VM and was curious to know more about it.
It is a virtual machine given by Laravel and contains all dependecies required for it.
The main advantage of using it is, if something crashes, it crashes on your VM and not your computer.
This makes it important to map your local files to the files on VM accurately. If they are not mapped correctly, you will lose the advantage of retrieving your files after a crash!

This is my Homestead.yaml file, where the mapping is supposed to be done :

It shows the IP to which the application is hosted.
Also, the folders section shows the mapping of local files to files on VM. Make sure to modify this with your address of files storage.

Next, is to make sure the IP mentioned in Homestead.yaml, is same as the one defined in your vagrant box.
Run the command : sudo nano etc/hosts : host file
You will be redirected to your box.
Noticed that is having the same IP as my homestead.yaml file? You need to update your host file with the same IP for the correct mapping of your project.

You can have a different IP for each project but you can always have the same IP for all projects to avoid confusion. But make sure you halt your Vagrant boxes before you switch from one project to another!

Important points while using Homestead
Share this

Subscribe to Rujuta Mahindrakar