6/9/2023 0 Comments Vagrant for mac homestead![]() ![]() All your local sites will run on the same IP.Īnd that's it.Despite working on Liquid Web’s Managed WordPress and Managed WooCommerce hosting products, a fair amount of the development work I do these days has very little to do with WordPress. Homestead is configured by default to run on 192.168.10.10, it's right at the top of Homestead.yaml. Edit the file and add a new entry like so: 192.168.10.10 awesomeproject1.test On a Mac you'll find it at /etc/hosts, while on a PC it's usually at C:\Windows\System32\drivers\etc\hosts (reason #63421 why I don't like coding on a PC). To: /home/vagrant/projects/my-awesome-project-1/publicįinal tip If you're having trouble loading the awesomeproject1.test URL in your browser, make sure you've configured the test domain properly in your hosts file. To: /home/vagrant/projects/my-awesome-project-1 Then you'd end up with the following config: folders: Let's say you want to organize your projects in Vagrant inside a projects sub-directory (why tho?). ![]() Or if you have to, keep in mind that you'll have to make a corresponding change to the sites section (and then re-provision the Vagrant box). Yeah, I'm not sure either if this is a smart way to organize projects but it's in my muscle memory so it works for me.įinally, I would discourage you from changing the Vagrant structure away from /home/vagrant/projectname. Mine is a little weird - all my projects go into the source directory, but inside that I have them grouped up by technology, so there are sub-directories for laravel, vue, etc. ![]() Your local project structure will very likely differ from mine so take that into account. This tells Vagrant to map the local (Mac, PC, etc) project folder ( ~/source/laravel/my-awesome-project-1 in my case) to the /home/vagrant/my-awesome-project-1 folder on the Vagrant box. Next, here's a little insight into how my local folder structure is set up, by looking at my folders YAML section. I think I did that when I was learning Laravel and it only caused issues. I would suggest not changing or messing with the default Homestead/Vagrant folder structure /home/vagrant/projectname. Digging a little deeperįirst of all, trying to be clever can bite you. The -provision flag also applies if, say, you decide to change the database. Heads up! After making changes to Homestead.yaml, if Vagrant is running, just run vagrant reload -provision to get it to reload and integrate your changes. The fix was to add the relevant entries for map and to. So when I loaded up the test site's URL awesomeproject1.test in my browser, I was presented with the always-charming "No input file specified" message. To: /home/vagrant/my-awesome-project-2/publicįor my latest project, for example, I had set up the sites and databases sections properly, but because I had a lot of sites and projects, I forgot to scroll to the folders section towards the top of the file. To: /home/vagrant/my-awesome-project-1/public map: ~/source/laravel/my-awesome-project-2 map: ~/source/laravel/my-awesome-project-1 To simplify things, I'll just show you the relevant portions of my own Homestead.yaml. More often than not, the "No input file specified" error happens when you don't map your local project to the Vagrant folder properly in your Homestead.yaml file. As such, these tips may only apply to a Homestead environment. I've never used Valet, Docker or other methods. Despite having started more Laravel projects than I can count, I'm still tripped out by this error, if I'm not paying attention.ĭisclosure My local environment has always been Homestead/Vagrant on a Mac or PC. The first few times I ran into the "No input file specified" error while trying to get a new Laravel project working in my local environment, it took me a while to figure out.įear not, Laravel beginners.
0 Comments
Leave a Reply. |