How is there not a step by step guide here? http://laravel.com/docs/5.0/homestead
Step by step setup guide for Homestead on OS X
Missing steps, I got to download and installing vagrant and virtual box, but lost from there. Tried the steps on the site, tried the steps in the VirtualMachine video but both poorly rush over what is required and where things are.
So, would love to learn laravel, I've been using yii for a few years. But cannot even get it installed.
Is there a link to a step by step install guide that actually works?
There is, but as I said it does not work for me when I follow it.
Manual setup via Git
I do the bash init.sh and it creates ~/.homestead, etc.
I edit the Homestead.yaml to add type:"nfs" to folders
No explanation in the guide as to what the map: and to: options are, but they are the default values and I leave them as is
map: ~/Code to: /home/vagrant/Code
Configure your Ngnix Sites I am not familiar with this but it says no problem.
Bash Aliases no idea if I need to add anything here.
Launch the Vagrant box I use terminal in the ~/Homestead folder and try to run homestead up and get this: -bash: homestead: command not found
Can you not use PHP CLI locally to install Homestead?
Is that the Composer + PHP Tool option?
I tried that but get a similar response.
composer global require "laravel/homestead=~2.0"
-bash: composer: command not found
I also tried running the homestead script with php like this in the Homestead directory:
php homestead up
Warning: require(/Users/tarouma/Homestead/../../autoload.php): failed to open stream: No such file or directory in /Users/tarouma/Homestead/homestead on line 13
Fatal error: require(): Failed opening required '/Users/tarouma/Homestead/../../autoload.php' (include_path='.:') in /Users/tarouma/Homestead/homestead on line 13
Did you have composer on your machine?
https://getcomposer.org/download/
or with brew (http://brew.sh/)
brew install composer
okay, i get it. i'm not up to speed with the latest and greatest so you just mess with me. nice way to spread the larval love.
so okay, i try your brew thing and i get the same thing, command not found.
So I install brew and follow it's steps then try your brew install composer and get this:
Error: No available formula for composer Searching formulae... Searching taps... homebrew/php/composer
Did it install? Let's see...
composer global require "laravel/homestead=~2.0"
-bash: composer: command not found
YAY! Installing Homestead is such a simple joy!
YAY! Installing Homestead is such a simple joy!
Installing Homestead is very simple, if you don't have your dev's environment ready it isn't Homestead's fault...
brew tap homebrew/homebrew-php
brew install homebrew/php/composer
Not so simple, since every command you give requires some dependency I don't have.
But I've finally got Homestead installed I think.
Now, I've gone to my Code folder pointed to in my yaml file and run this to try to create a larval project
composer create-project laravel/laravel Laravel --prefer-dist
It tries but throws errors and Installing laravel/laravel (v5.0.1)
- Installing laravel/laravel (v5.0.1) Downloading: 100%
Created project in Larval Loading composer repositories with package information Installing dependencies (including require-dev)
[RuntimeException]
Could not load package dragonrun1/phpspec in http://packagist.org: [Unexpec
tedValueException] Could not parse version constraint ^1.0.1: Invalid versi
on string "^1.0.1"
[UnexpectedValueException]
Could not parse version constraint ^1.0.1: Invalid version string "^1.0.1"
create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [package] [directory] [version]
Hmm... lets go see if it worked despite the errors and warnings
Warning: require(/home/vagrant/Code/Laravel/bootstrap/../vendor/autoload.php): failed to open stream: No such file or directory in /home/vagrant/Code/Laravel/bootstrap/autoload.php on line 17
Fatal error: require(): Failed opening required '/home/vagrant/Code/Laravel/bootstrap/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/vagrant/Code/Laravel/bootstrap/autoload.php on line 17
Oh boy I must be getting close!
Just do
php composer update // or use "install" if it gives warnings
Not so simple, since every command you give requires some dependency I don't have.
These dependencies are always installed on developper's machine.
That's a huge assumption you are making.
I develop PHP. My Mac comes with Apache, PHP and MySQL already. I want to use Yii, I copy it to my webroot, run a few console commands and it's ready.
So, all I am saying is that whoever is writing the guides should consider that not every developer is going to have the same environment and already have the tools it's being assumed they have.
Bear in mind that the creator of the framework has no obligation to help you setup your PHP environment properly. It tells you the requirements so as a PHP developer, you should know how to setup PHP.
There's videos here on how to do it, worked for countless people.
I bear that in mind, but I assume that the creator would like for people to be able to use their creation.
And no, it does NOT tell you the requirements.
And so the videos worked for countless people, that doesn't really help me and probably another countless others.
It seems strange that a framework community would have such a fuck you attitude about people trying to do things with the framework. I hope that's just a few people and there aren't countless others here with that attitude.
So here I continue my own How to Set Up Laravel Homestead In Less Than A Week Guide.
php composer update
Could not open input file: composer
perhaps some progress! I see that there is no vendor folder in my ~/Code/Laravel folder (/home/vagrant/Code/Laravel/bootstrap/../vendor/autoload.php)
but I have this in my ~/composer/vendor folder
Is that what this thing is looking for? I don't know! If so, why is it looking for it over there? No idea.
Hmm.. maybe I should just delete all this crap and try over now that I have dependencies that the guide didn't mention I needed install (somewhere)
Oh boy, there's a VM with that name running already. delete all that crap too.
homestead update doing something... doing other stuff... running blah blah blah stdin is not a tty
well is that it? let's find out!
http://homestead.app No input file specified.
Hmm google that. I see it's missing the project files. Go to ~/Code and run composer create-project laravel/laravel Laravel --prefer-dist
Installing laravel/laravel (v5.0.1)
- Installing laravel/laravel (v5.0.1) Loading from cache
Created project in Laravel Loading composer repositories with package information Installing dependencies (including require-dev)
[RuntimeException]
Could not load package dragonrun1/phpspec in http://packagist.org: [Unexpec
tedValueException] Could not parse version constraint ^1.0.1: Invalid versi
on string "^1.0.1"
[UnexpectedValueException]
Could not parse version constraint ^1.0.1: Invalid version string "^1.0.1"
create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repository-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--keep-vcs] [--no-install] [package] [directory] [version]
Okay, pretty much back to where I started this evening, some package called dragonrun1/phpspec
oh wait let me try that great
(php not needed)composer update no composer.son found where is that dang thing? cd Laravel well there's one composer update Same thing, that danged dragonwhatever oh wait! the brilliant option! composer install
same thing,
[RuntimeException]
Could not load package dragonrun1/phpspec in http://packagist.org: [Unexpec
tedValueException] Could not parse version constraint ^1.0.1: Invalid versi
on string "^1.0.1"
[UnexpectedValueException]
Could not parse version constraint ^1.0.1: Invalid version string "^1.0.1"
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]
Any idea what I have not set up right in my dev env that is causing this?
Hmm.. gotta create that project again
okay great back to that error about phpsec dragon something
~/Code/Laravel composer update same error.... composer selfupdate composer update oh yay! Finally a new error!
Problem 1 - laravel/framework v5.0.9 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.8 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.7 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.6 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.5 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.4 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.3 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.2 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.14 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.13 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.12 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.11 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.10 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.1 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - laravel/framework v5.0.0 requires ext-mcrypt * -> the requested PHP extension mcrypt is missing from your system. - Installation request for laravel/framework 5.0.* -> satisfiable by laravel/framework[v5.0.0, v5.0.1, v5.0.10, v5.0.11, v5.0.12, v5.0.13, v5.0.14, v5.0.2, v5.0.3, v5.0.4, v5.0.5, v5.0.6, v5.0.7, v5.0.8, v5.0.9].
Okay, let's see what I gotta do now
brew install mcrypt brew install php56-mcrypt
composer update
hmm... that's all it took. i don't know why they couldn't just put that shit in the guide.
You seem to not have a good understanding of the command line and how commands are executed. Would you like me to fix it for you over teamviewer while on Skype?
composer self-update
instead of composer update
I am also experiencing a problem at every turn. It would be great to have just one guide that after each step are links to solutions for all the many many pitfalls along the way. The Mcrypt fiasco alone ate away too many hours of my life. I think the problem is that Laravel is not for SysAdmins who live in the CLI, it's for web developers, not all of which are also CLI wizards. Some of us just want to have a nice framework for us to code PHP/HTML/CSS/JS/JQ/Angular/Etc. And for us, when we see a comment like "just run this command" it's very frustrating because dude, we ran that command, believe me. We ran that command.
So you're not alone man. Just look at Stack Overflow. You will see "answers" like duh why didn't you just use Home Brew. Or MacPorts. Or Composer. Or Homestead. Do you have XCode? Did you link the path to your SSH key correctly? Which installation of PHP on your machine are you pointing to and do you know where to change that? Did you edit your Homestead.yaml file even though the docs don't explain what half of that stuff means? And the Stack Overflow article that looks like it perfectly fixes your problem winds up being for a different OS so you can't use it. All very frustrating just to get one framework to work.
But I just signed up here, and I trust that the Jeffery Way will save us! There are a lot of videos here so I'm really hoping they address some of these many difficulties!
Ok, now that I've spent a couple days understanding things, here's a suggestion for others having issues:
The main thing missing from this guide and from a lot of the other sources out there is that once you've followed these steps and setup the environment, you have to move into your root code directory and SET UP A NEW SITE, in my case ~/Code/Projects on OS X, and run from your command prompt:
laravel new my_site
You should now have:
~/Code/Projects/my_site with the Laravel 5 structure all built up.
If your hosts file is setup correctly (which is covered): 192.168.10.10 my_site
And in your ~/.homestead/Homestead.yaml file (command "homestead edit" will bring it up for you):
folders: - map: ~/Code/Projects to: /home/vagrant/Projects sites: - map: my_site to: /home/vagrant/Projects/my_site/public
Finally, from command prompt: homestead up
You should be able to get the Laravel default home page at this point.
In my case, I kept making changes to the Homestead.yaml to point to the site I wanted to work on, but the site itself had yet to be created.
Hope that helps someone else. Yeah, it's easy as hell when you're up and running, but so many details are scattered about that everyone would benefit from a true from-scratch tutorial, IMO.
I know this is an old thread, however hopefully I can help other people looking at this thread in hopes of guidance.
I do have to say that @tarouma did have a point when saying that this documentation is missing some stuff that would cause a beginning developer or someone without modern php experience some difficulty.
Notably, one thing that I think may have been an issue as I ran into it myself is that in the documentation it says to run the php vendor/bin/homestead make command without ever saying to run composer install. The homestead command references the autoload.php file that is created by composer and will not work unless this command is ran.
While this took me no time to figure out, my JR. dev had been hung up on this for over an hour as composer is new to him.
There is also an assumption of base knowledge in this documentation. One (of a few that I have found) instance is the configuring of shared folders. Can you configure more than one directory? If so how? Also, does 'map' or 'to' refer to the client or host machine?
While I can look at the configs without reading the docs and still figure this out, that isn't the case with everyone. And if we as a community can't be understanding of people trying to learn then that isn't much of a community.
Overall I feel that this thread had WAY more negativity (on both sides of the discussion) that possibly just made things more frustrating and difficult.
--CANT WE ALL JUST GET ALONG
Please or to participate in this conversation.