69

I'm having trouble getting a test instance of Laravel 5.0 up and running so I can assist with this transition.

1) Creating a new app from https://github.com/laravel/laravel/tree/develop leads to the following error when running composer install.

{"error":
    {"type":"ErrorException",
     "message":"Undefined index: timezone",
     "file":"\/Projects\/indatus\/dispatcher-test-app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/start.php",
     "line":167}
}
{"error":
    {"type":"ErrorException",
     "message":"Undefined index: timezone",
     "file":"\/Projects\/indatus\/dispatcher-test-app\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/start.php",
     "line":167}}

Am I completely missing something?

UPDATE: This question/answer was only relevant when Laravel 5 was in the development stage. You should now reference the Laravel Documentation for how to install Laravel

Ben
  • 60,438
  • 111
  • 314
  • 488

5 Answers5

124

As Laravel 5 is already final release, to install it, you should run

composer create-project laravel/laravel test-laravel-5-project --prefer-dist 

in your console. test-laravel-5-project is the name of your project you can call it anyway you want - for example myblog, myapp etc. Laravel files will be put inside this directory

You can also use alternative method using

composer global require "laravel/installer=~1.1"

and then running

laravel new test-laravel-5-project 

For detailed info you should look at official Laravel installation notes


The below answer is being kept only for historical reasons and it was valid when Laravel 5 still was in its development stages. You should now only use the method mentioned above

I've just tested this and there are two ways of installing Laravel 5:

One-step method

You just run:

composer create-project laravel/laravel test-laravel-5-project dev-develop --prefer-dist

and composer will create the whole directory structure. In above command test-laravel-5-project is your project name - you can of course name it as you want (composer will create directory with this name and put all Laravel5 files inside this directory)

Multi-step method

  1. Download https://github.com/laravel/laravel/tree/develop with option Download ZIP
  2. Unpack it in web directory
  3. Run composer update (not composer install) in directory where you unpacked your ZIP file

Using both methods when you run URL for your project in the browser (for example http://localhost/projects/test-laravel-5-project/public depending on your webserver settings ) you will get standard Laravel website You have arrived.

Both methods should work well. Give either one a try, whichever works best for you.

silkfire
  • 24,585
  • 15
  • 82
  • 105
Marcin Nabiałek
  • 109,655
  • 42
  • 258
  • 291
  • How did you know to use `test-laravel-5-project`? Lucky guess or found it documented somewhere? I wasn't able to find it... – Ben Sep 22 '14 at 11:53
  • 5
    @Webnet `test-laravel-5-project` is the name of project you want to create. You can put here anything you want for example `dating` if you are creating Dating site and so on. I've just edited my answer to make it clear – Marcin Nabiałek Sep 22 '14 at 11:56
  • I have tried this: `composer create-project laravel/laravel test-laravel-5-project dev-develop --prefer-dist` with no success, only downloading from github and running composer update has worked. – Ademir Mazer Jr - Nuno Oct 20 '14 at 13:19
  • @AdemirNuno And what result you got after running this command? – Marcin Nabiałek Oct 20 '14 at 13:20
  • Got: `[InvalidArgumentException] Could not find package laravel-laravel with version dev-develop.` – Ademir Mazer Jr - Nuno Oct 20 '14 at 13:21
  • 2
    @AdemirNuno Are you sure you used exact same command? From your error it seems you used `laravel-laravel` instead of `laravel/laravel` after `create-project` – Marcin Nabiałek Oct 20 '14 at 13:26
  • @MarcinNabiałek really, I was typing it wrong. So simple mistake, thanks a lot. – Ademir Mazer Jr - Nuno Oct 20 '14 at 13:43
  • It works, i think i accidentally marked another answer as correct on my phone when i meant to upvote – Ben Nov 03 '14 at 21:11
  • fyi, this stopped working: Installation request for laravel/framework ~5.0 -> satisfiable by laravel/framework[5.0.x-dev]. – Toby Dec 06 '14 at 23:14
  • @Tobias I've just tested it and the command I gave in my answer works without a problem – Marcin Nabiałek Dec 07 '14 at 09:09
  • I've run this command and it works perfect: `composer create-project laravel/laravel my_app_name dev-develop --prefer-dist` – ajtrichards Dec 27 '14 at 19:11
  • inside the project folder you could try `php -S localhost:8000 -t public` in terminal – Tarek Kalaji May 11 '15 at 09:17
  • In third method we need to execute php artisan key:generate or else we will get and exception of CSR access token and also we need to set up .env file – Akshay Khale Aug 21 '15 at 05:03
  • What does "dev-develop" mean / refer to? – Inigo Mar 06 '16 at 11:15
  • This [post](http://docker.lhsm.com.br/93e98d5d-ec9e-464c-894b-e2ac62fe1203) can be helpful with this solution –  Jan 25 '19 at 13:37
8

Go to CLI and enter following command line. make sure composer is already installed.

$composer create-project laravel/laravel <yourdirectryname> dev-develop It will ask you a question about removing .git files enter Y then. change the directory to

$cd <yourdirectoryname> then enter following command

$ php artisan -V

you will be able to see following message.

Laravel Framework version 5.0-dev means you have installed laravel 5 successfully!

Rikin Adhyapak
  • 483
  • 5
  • 8
1

Run this command from where you want to store your project

composer create-project laravel/laravel <projectname>

Remember, it will download the latest version of laravel application from git.

if you are using linux then give permission to bootstrap/cache and storage by running the command chmod 777 -R <dir name> from root of your laravel project

Vikash
  • 219
  • 5
  • 13
0

composer global require "laravel/installer=~1.1"

Karthiga
  • 859
  • 2
  • 17
  • 33
0

First you need to install laravel globally in your system by this command

composer global require laravel/installer then you can install laravel by three ways, 1) Go to laravel github Reqosritory and download it's zip, and second it get ssh or Https url and install it from CMD or Git bash 2) open Git bash just write laravel new there, this will download the latest laravel verision 3) open cmd or git bash and write there. composer create-project --prefer-dist laravel/laravel blog if you want to install some old version then you can write the mention the version in last. composer create-project --prefer-dist laravel/laravel blog 5.2.*

Hassan Raza
  • 501
  • 7
  • 8