問題描述
我在啟動(dòng)和運(yùn)行 Laravel 5.0 的測試實(shí)例時(shí)遇到問題,因此我可以協(xié)助完成此轉(zhuǎn)換.
1) 從 https://github.com/laravel/laravel/tree 創(chuàng)建一個(gè)新應(yīng)用/develop 在運(yùn)行 composer install
時(shí)會(huì)導(dǎo)致以下錯(cuò)誤.
{錯(cuò)誤":{"type":"ErrorException","message":"未定義索引:時(shí)區(qū)","文件":"/Projects/indatus/dispatcher-test-app/vendor/laravel/framework/src/Illuminate/Foundation/start.php",線":167}}{錯(cuò)誤":{"type":"ErrorException","message":"未定義索引:時(shí)區(qū)","文件":"/Projects/indatus/dispatcher-test-app/vendor/laravel/framework/src/Illuminate/Foundation/start.php",線":167}}
我是不是完全遺漏了什么?
更新:這個(gè)問題/答案僅在 Laravel 5 處于開發(fā)階段時(shí)才相關(guān).您現(xiàn)在應(yīng)該參考 Laravel 文檔 了解如何安裝 Laravel
由于 Laravel 5 已經(jīng)是最終版本,要安裝它,你應(yīng)該運(yùn)行
composer create-project laravel/laravel test-laravel-5-project --prefer-dist
在您的控制臺(tái)中.test-laravel-5-project
是你的項(xiàng)目名稱,你可以隨意調(diào)用它 - 例如 myblog、myapp 等.Laravel 文件將放在這個(gè)目錄中
您也可以使用替代方法
composer global require "laravel/installer=~1.1"
然后運(yùn)行
laravel new test-laravel-5-project
有關(guān)詳細(xì)信息,您應(yīng)該查看官方 Laravel 安裝說明
<小時(shí)>以下答案僅出于歷史原因保留,并且在 Laravel 5 仍處于開發(fā)階段時(shí)有效.你現(xiàn)在應(yīng)該只使用上面提到的方法
我剛剛對(duì)此進(jìn)行了測試,有兩種安裝 Laravel 5 的方法:
一步法
你只需運(yùn)行:
composer create-project laravel/laravel test-laravel-5-project dev-develop --prefer-dist
和 composer 將創(chuàng)建整個(gè)目錄結(jié)構(gòu).在上面的命令中 test-laravel-5-project
是你的項(xiàng)目名稱 - 你當(dāng)然可以隨意命名(composer 將使用這個(gè)名稱創(chuàng)建目錄并將所有 Laravel5 文件放在這個(gè)目錄中)>
多步法
- 使用選項(xiàng)
下載https://github.com/laravel/laravel/tree/develop下載郵政編碼
- 解壓到web目錄
- 在解壓 ZIP 文件的目錄中運(yùn)行
composer update
(不是composer install
)
在瀏覽器中為項(xiàng)目運(yùn)行 URL 時(shí)使用這兩種方法(例如 http://localhost/projects/test-laravel-5-project/public
,具體取決于您的網(wǎng)絡(luò)服務(wù)器設(shè)置)將獲得標(biāo)準(zhǔn)的 Laravel 網(wǎng)站 您已經(jīng)到達(dá).
這兩種方法都應(yīng)該很好用.試一試,選擇最適合您的那個(gè).
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
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
- Download https://github.com/laravel/laravel/tree/develop with option
Download ZIP
- Unpack it in web directory
- Run
composer update
(notcomposer 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.
這篇關(guān)于如何安裝 Laravel 5.0的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!