Go ahead with Telegram because a bunch of Laravel Devs use it anyway.
Hi, If you still having trouble with Homestead, may be it's best to skip it and use Laravel Valet. It's really easy to setup than homestead. May be give it a crack with Laravel Valet.
Thanks sandeep09, I have it up and running now on my personal machine. This is due to a large part because of @ejdelmonico kindly walking me through the process from where I had got to, to the conclusion. Shout out to ejdelmonico for pitching in and persevering until it was running! (Thanks again ejdelmonico).
Deleting and re-doing ~/Homestead and create a new Laravel project:
I did intend to write out the full steps we followed in case anyone else had my particular issues after following the Homestead install documentation & getting issues, but since then, I successfully got Homestead running on a second machine and took quite a different path to get there.
There were some common problems which I'll put below in detail in case it helps someone new to this, but please be careful if following along, especially when deleting content.
Disclaimer - this worked for my environment & the order etc that this was done, methods, etc may not be entirely correct!
First off:
OSX PHP version too old - fix this first: OSX 10.11.6 El Capitan - ships PHP 5+ version too low - causes errors when running $ composer update, messages like these:
Problem 1
- This package requires php >=5.6.4 but your PHP version (5.5.38) does not satisfy that requirement.
Fix: If not already installed, you can install Homebrew package installer designed for OS X (or if installed, $ brew update), use this to install the latest version of PHP (at time of writing 7.1)
$ brew install homebrew/php/php71
Install $ brew install homebrew/php/php71-mcrypt as well. Laravel used to require it, not sure if it still does. I would just install it while you are there. Then $ php -v to check the version.
Virtual Machines still running? (from earlier projects not displaying the Laravel splash page)
Need to destroy these before re-creating the new project. To check:
$ cd ~/Homestead and $ vagrant box list you may see something like this:
laravel/homestead (virtualbox, 0.3.3)
laravel/homestead (virtualbox, 1.1.0)
I $ cd . . up and (careful!) deleted the ~/Homestead directory so it could be re-cloned from the repo: $ rm -rf Homestead
Then I deleted the ~/Code/homestead project that wasn't working correctly.
Before cloning Homestead again, open up the virtual box IDE and check the left pane to see if any homestead boxes are still up, if so, right click > 'remove all files'
Then $ vagrant global-status to check. If some boxes still show (like this) they need to be removed.
id name provider state directory
-----------------------------------------------------------------------------
d81b64c my-homestead virtualbox running /Users/rich/Code/my_homestead
1480d05 homestead-7 virtualbox running /Users/rich/Homestead
Try $ vagrant halt {your box id} --force then $ vagrant destroy {your box id} --force then check again $ vagrant global-status
If boxes still show, the information may be cached, so I ran $ vagrant global-status --prune and the output showed no boxes with a message:
There are no active Vagrant environments on this computer!
I installed Homestead again from the source:
$ cd ~ then git clone https://github.com/laravel/homestead.git Homestead
And redid the project inside the ~/Code directory: laravel new homestead
Cd into ~/Code/homestead/ an ran $ npm install and compiled $ npm run dev
Then in ~/Code/homestead/ $ vagrant up
Then in the browser: http://homestead.app showed the splash Laravel page! Success!
Related Notes: The first time I created a project, I did so before updating OS X version of PHP to 7.1 and the application was ready, but had PHP problem messages, even though Homestead comes with PHP 7.1, I can't be certain that this was causing issues, but after updating it and redoing it all, things went much more smoothly.
Missing .env file Not sure why, but the first time I created a new Laravel project inside my ~/Code directory, there was a .env.example but no .env file - nuking ~/Homestead and reinstalling it & the project fixed that.
No input file specified
An error from a different project where Homestead was working- this turned out to be a simple site path mismatch in the .homestead/Homestead.yaml file - it was trying to map to a folder that didn't exist in the vagrant box. To check folders in the VM, inside ~/Homestead run $ vagrant ssh and take a look at the directories - my .yaml file was trying to connect to Laravel/public, whereas the VM had homestead/public. so updated that.
sites:
- map: homestead.app
#wrong! to: /home/vagrant/Code/Laravel/public
to: /home/vagrant/Code/homestead/public # correct path
From the docs:
If you change the sites property after provisioning the Homestead box, you should re-run vagrant reload --provision to update the Nginx configuration on the virtual machine.
Hope this helps someone! If there are any obvious typo's errors etc - apologies in advance.
Please or to participate in this conversation.