Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
247 views
in Technique[技术] by (71.8m points)

php - How to install Laravel 5.0

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...