Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Laravel 4 Basics Getting Started with Laravel Installing Laravel Homestead

Stephen Printup
seal-mask
.a{fill-rule:evenodd;}techdegree
Stephen Printup
UX Design Techdegree Student 45,252 Points

Vagrant Up: files not found

Ok, so I think I messed up-

I found this link: http://stackoverflow.com/questions/27243418/vagrant-up-command-fails

and ran $ vagrant init hashicorp/precise32

as per https://docs.vagrantup.com/v2/getting-started/index.html

and now my command line reads vagrant@precise32:~$ instead of vagrant@homestead:~$ like in the video. I think I've installed an alternative virtual box or something, but I really have no idea. Any help to get me back on track would be appreciated.

My initial problem was that I was getting errors when running vagrant up (unable to find base or code, etc.) The current Laravel file structure is a bit different than in the video and the homestead.yaml file is in homestead/src/stubs instead of in just homestead.

Finally, I initialized vagrant like 3 times (deleting the only vagrant file I saw every time), but am still unclear on where I should put it. Does it now go in homestead/src/stubs or just in homestead. Will the vagrant up command create the code file and base file? Hmm, thanks for any help you can provide.

FYI my homestead.yaml file reads:

ip: "10.0.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: /Users/stephenprintup/.ssh/id_rsa.pub

keys:
    - /Users/stephenprintup/.ssh/id_rsa

folders:
    - map: ~/Users/stephenprintup/Homestead/Projects
      to: /Users/stephenprintup/vagrant/Sites

sites:
    - map: laravel.dev
      to: /home/vagrant/Sites/laravel-basics/public

databases:
    - homestead

variables:
    - key: APP_ENV
      value: local

-Stephen

3 Answers

Ok, so you don't want use the precise32 box. You are correct in thinking that you installed a different box. Precise32 is a standard Unbuntu box not the homestead box. You want to install the laravel/homestead box.

vagrant box add laravel/homestead

The file structures are different because the videos were recorded using Laravel 4.2 and the new version is Laravel 5.1 and they made lots of changes to the file structure of the app. If you want to you can download the older Laravel 4 and follow along with the videos exactly. Here is a snippet from the Laravel docs on installing the older the version of Laravel.

Via Composer Create-Project

You may also install Laravel by issuing the Composer create-project command in your terminal:

composer create-project laravel/laravel {directory} 4.2 --prefer-dist

This instructions were found in the Laravel docs here: http://laravel.com/docs/4.2

FYI Laravel versions went 4.0, 4.1, 4.2, then straight to 5.0, 5.1 Treehouse just had bad timing in that the versions jumped with major changes only a few months after they put out the videos.

Let me know if this helps or if you still have questions.

Stephen Printup
seal-mask
.a{fill-rule:evenodd;}techdegree
Stephen Printup
UX Design Techdegree Student 45,252 Points

Ok, so I'm just learning here. But if I install the old version of Laravel so the videos match up and I use composer, I'll have to list dependencies for the project? I'm having trouble getting going with composer as well, I tried watching how to install composer here: http://teamtreehouse.com/library/building-websites-with-php but it was already installed.

I ran php -r "readfile('https://getcomposer.org/installer');" | php found here: https://getcomposer.org/download/ but it just downloaded a single file. I'm not sure messing with composer will be worth sitting through this course. I'm basically interested in learning, so I may just not install these pieces of software yet. However, the next quiz (https://teamtreehouse.com/library/installing-laravel) has a question "Did you get Laravel installed using Homestead?" with Yes/No. Apparently, no is the wrong answer and if I was a computer I wouldn't know how to proceed. Thank you for your help!

Stephen Printup
seal-mask
.a{fill-rule:evenodd;}techdegree
Stephen Printup
UX Design Techdegree Student 45,252 Points

Ok, just to be clear:

Vagrant: is a wrapper for virtual box (needs to be installed before virtual box)

Virtual box: is a visualization environment (needs to be kept in the application folder, primarily)

Laravel: is a PHP framework (basically a DOM tree, that can be downloaded with each new project)

Composer: is a dependency management tool.

I got composer running, but this other stuff is still kind of out there. I tried deleting files, but couldn't, so now I'm kind of screwed. I've already done the PHP track, but do you suggest other material also?

Thanks again for your help

-Stephen