I have been learning Laravel 5 (using the Laracasts, lynda.com and the book Easy Laravel 5 by Jason Gilmore) over the past few weeks, and enjoying it thoroughly.
I have always used XAMPP on Windows when developing websites and applications, so I have been skipping over the parts on Homestead. But I am starting to wonder if it would be useful for me to know Homestead too.
Is there an advantage to developing a Laravel-based application using Homestead over XAMPP? If so, it would probably be worth my while not skipping that step. (I have studied Web Hosting with Linux and Ubuntu, so I am comfortable with command line, but not an expert by any means.)
There are several advantages. Bruno, the local PHP Guru goes through and explains a lot of good reasons in his article about Vagrant and starting with PHP developing with it.
Yes, a few hours of your time is worth learning how to set-up the vm.
Okay, thanks. Then I will definitely go back and set that up and use it in the future for all my practice applications.
There’s definitely an advantage. @swader could give you an earful about it
Good reads (by Bruno):
How to get a Homestead box running quickly:
And more reasons why to use Vagrant:
Thanks for the recommendations, guys : )
@WebMachine if you get stuck, let us know! I’m in the process of updating that quick tip btw, it’ll become even quicker to set up soon.
I didn’t even see your answer, literally read right past it, till Bruno said recommendations, plural, and I checked again to see whose answer I’d probably duplicated
Actually I am stuck.
I am using the ebook Easy Laravel 5 by Jason Gilmore and got as far as installing Vagrant, Virtual Box and the Homestead box and stalled at the command
homestead init with the error message " ‘homestead’ is not recognized as an internal or external command, operable program or batch file. "
I went back to the Laracast “Laravel 5 Fundamentals” I had worked through (having skipped the section on Homestead and used my XAMPP) and started going through the video on Homestead but ran out of time. Before I return to that, I am going to read those two articles that @jeffreylees recommended.
Okay, I got past that part using a different CLI. Now I’m stuck at a point where my paths were wrong pointing to homestead.yaml. I managed to fix those, and it messed up another path. All the articles I read claim using Homestead will make the whole process easy and fun (Yes, they said ‘fun’). I can’t seem to get to the point where I can actually use Homestead with my Laravel development.
Here is what I have -
Here’s the part of my homestead.rb file that is causing the error:
# Configure The Public Key For SSH Access
if settings.include? 'authorize'
config.vm.provision "shell" do |s|
s.inline = "echo $1 | grep -xq \"$1\" /home/vagrant/.ssh/authorized_keys || echo $1 | tee -a /home/vagrant/.ssh/authorized_keys"
s.args = [File.read(File.expand_path(settings["authorize"]))]
and the part of my Vagrantfile that I adjusted to fix the path to the homestead.yaml file and a few others:
VAGRANTFILE_API_VERSION = "2"
confDir = $confDir ||= File.expand_path("~/Homestead")
homesteadYamlPath = confDir + "/src/stubs/Homestead.yaml"
afterScriptPath = confDir + "/src/stubs/after.sh"
aliasesPath = confDir + "/src/stubs/aliases"
require File.expand_path(confDir + '/scripts/homestead.rb')
Could somebody please point me in the right direction. Right now I feel like I’m flying blind-folded.
Okay, so I’m not getting any help with this. Maybe I should start fresh, delete everything I’ve done so far, and try with @swader 's suggestions and Bruno’s tutorial and articles, without using my other resources.
Trouble is, I hate to abandon an attempt at something without at least figuring out exactly what went wrong and how to fix it.
Sorry, I don’t know enough about Vagrant and etc to be of much more help. For me, though, I’d rather clear it, do it the other way if that works, and move on than troubleshoot it, in this case - I’m not a VM person, so as long as it works or I can figure it out, it’s not worth my time to troubleshoot setup problems for my own stuff unless there’s no alternative.
I understand being curious, but your time is worth something too
I’d start afresh and use only one set of “How to’s”. Don’t mix and match, as that usually leads to something messing up, some how in some way.
I personally started with this tutorial and used PuPHPet, as it sets up Vagrant to build the exact VM that I want.
Thanks, Scott. I’ll do that then.
This might sound like a stupid question, but not ever having set up Vagrant and Homestead and venturing into totally uncharted territory for me, is there any harm in my just deleting all the relevant folders, or do I risk missing something?
Which folders do you mean exactly? I wouldn’t delete the Vagrant or Virtualbox files or rather the files that were installed with the software. Those installations shouldn’t really be the problem.
Did you see the screenshot I posted above of my terminal where I tried ‘vagrant up’ in the Homestead directory? There is an issue with one of the paths.
I am sorry to say, I have no experience with Homestead. As I mentioned, I used PuPHPet. Maybe it would be better to uninstall and reinstall Vagrant, if that is where you think you are having problems.
I think this thread may end up in a different forum - it turns out that on my laptop (MSI MS 1755), virtualization is supported, but disabled. I have spent all evening hunting everywhere in my BIOS and on Google and can’t find where to enable it.
Ah… yes I remember that issue. F**kin windows – nothing is easy. Though it has been about 2 years since I had to deal with it so can’t exactly recall how to fix it. Perhaps search on google “windows enable virtualization” and see if you can’t find something.
Apparently the problem is with my make and model of laptop - it technically is a gaming laptop (don’t know if that’s the reason MSI made it impossible to find where to enable virtualization), but when I go into the BIOS, that feature is not there. However, I used Speccy to take a look, and apparently it is supported, just not enabled.
Maybe there is an upgrade of your bios, which will allow the virtualization?