Spent 4 days trying to install Laravel -> Nope.

Can I be rude? This is probably your fault.

I know that, because it was my fault. I had been doing such crappy work that my machine's development environment was all out of date. I ended up having to jump through down so many rabbit holes that I got lost and confused. Each step I made progress through to, just brought me to another thing that didn't work.

The fact is, it's hard to start learning new things. You encounter "friction", where things just don't work as you expect, or things are hard.

The first thing you need to do is... well, tell us what the actual problem is. You don't need iTerm2. You need VirtualBox. You need Vagrant. You need to get the Homestead box with Vagrant. Actually the process is a little more complex now than it used to be. But if you follow the instructions you will be fine.

First of all, this is a sequence of things.

Most of this is from here.

You need to take each step one at a time and do it to completion. What you're probably struggling with is a lack of core knowledge on the MacOSX platform. I know I was. The other problem I had was that I didn't really know what I was installing. I just did it because I was told. I'll explain them for you. If you already know stuff and I'm patronising you, then I apologise, but it's better to say stuff you already know than leave it out and assume.

First of all, install VirtualBox. You'll want the one listed as "VirtualBox 4.3.20 for OS X hosts". There shouldn't be any issue with installing this. If you already have it and it's working, disregard this. VirtualBox is a virtual machine hosting system, allowing you to have an OS running inside another OS. You probably know that, but anyway.

Secondly, install Vagrant. Vagrant is a system to handle and manage the operating systems run by VirtualBox. Again, you can download it from the interwebs. Once you install it, you can confirm that it's working by just typing "vagrant" anywhere in your command line. If it shows a list of command options it's all good. If it DOESN'T, then stop and try and find out why.

Third, install the homestead box. This is nothing fancy, it's just an Ubuntu vagrant box, a pre-packaged OS with the stuff you'll need for Laraveling. You can download it with a vagrant command: vagrant box add laravel/homestead. This will take some time to download. It's an entire OS.

This used to be the end of the process, but unfortunately, newer versions of Homestead have special advanced features making them far harder to install. YAY!

You need to install Composer. Composer is a dependency management tool for PHP. That's the textbook answer. But it can also be used as a sort of installer. That's what we're using it for here, and will again soon.

Installing composer is trivially easy. Command line: curl -sS https://getcomposer.org/installer | php.

Installing composer so that it actually works is a little harder. By default composer is installed in a location that typing composer in a command line won't do anything. Because composer isn't in a directory that the system can access automatically (known as PATH). You can fix that by immediately running mv composer.phar /usr/local/bin/composer. That will move the downloaded file into the happy directory for it to be run when you type composer. If that doesn't work, which is pretty common, use the sudo command to force it. So : sudo mv composer.phar /usr/local/bin/composer. You'll have to use your password to confirm the action. This happens because the /usr/local/bin directory is kind of a high level one.

In conclusion:

curl -sS https://getcomposer.org/installer | php sudo mv composer.phar /usr/local/bin/composer

Will DEFINITELY install composer, and correctly set it up. I suspect this was the problem you were having. The general installation instructions for composer skip this step because it's not technically necessary. But a lot of tutorials, examples, etc, assume you've done it. This means their steps fail with a "Command not found" message. Just like vagrant, type composer into the command line and if you get a list of options you're golden. If you get an error stop immediately and fix it. Come back here and ask, or PM me.

There is another tiny step that we need to do for composer, and this isn't well covered in the docs, so it's easy to miss: Just because we can run composer itself from the command line doesn't mean the shit we install using it can run. We want to add composer's "installed stuff" directory to the magic happy directory as well.

/r/laravel Thread