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

Roy Penrod
Roy Penrod
19,810 Points

Can't get Laravel install via Composer to work on Windows 7

I'm running WAMP with PHP 5.5.12 on Windows 7.

I've installed Composer and it's working.

I meet the requirements for Laravel.

I installed Laravel and I can see it in C:\Users{username}\AppData\Roaming\Composer\vendor\bin.

I've added that directory to my path so I can find it via the CLI, but I can't get the laravel new command to work.

It just says laravel is not recognized as an internal or external command, operable program, or batch file.

I even tried going directly into that directory and trying to run it from there to see if it's a problem with my path, but it gave me the same error.

Any ideas what's wrong and how to fix it?

2 Answers

jason chan
jason chan
31,009 Points

https://youtu.be/E6KHP7G_4Ao this guy shows you

make sure when you type in

composer 
//it shows image below for composer to successfully install

composer

composer create-project laravel/laravel laravel4 4.2 --prefer-dist

To follow composer 4 at teamtreehouse. All the laravel versions have different syntax so only install the version the tutorial is for or you will have to learn it by yourself through documentation.

Create a new database in phpmyadmin connect to phpmyadmin with the following credentials. I recommend taking the database course here at teamtreehouse and playing around with phpmyadmin to figure out how mysql works.

app/config/database.php

'mysql' => array(
    'read' => array(
        'host' => 'localhost',
    ),
    'write' => array(
        'host' => 'localhost'
    ),
    'driver'    => 'mysql',
    'database'  => 'database_name_here',
    'username'  => 'root',
    'password'  => '',
    'charset'   => 'utf8',
    'collation' => 'utf8_unicode_ci',
    'prefix'    => '',
),

https://laravel.com/docs/4.2/database

Please be patient with the download for laravel it may take 5 minutes to finish downloading.

Roy Penrod
Roy Penrod
19,810 Points

Thanks, Jason. I haven't had time to test the alternate method out, but I'll give it a shot in the next couple of days. Appreciate your help.

jason chan
jason chan
31,009 Points

Yeah no problem. To be honest getting stuff to working on window or mac is half the battle. goodluck man.