我无法启动并运行Laravel 5.0的测试实例,因此我可以协助进行此转换 .
1)从https://github.com/laravel/laravel/tree/develop创建新应用程序会在运行 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}}
我完全错过了什么吗?
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
4 回答
由于Laravel 5已经是最终版本,要安装它,你应该运行
在你的控制台中 .
test-laravel-5-project
是您可以随意调用的项目名称 - 例如myblog,myapp等.Laravel文件将放在此目录中您也可以使用替代方法
然后跑
有关详细信息,请查看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
我刚试过这个,有两种方法可以安装Laravel 5:
One-step method
你刚跑:
和composer将创建整个目录结构 . 在上面的命令中
test-laravel-5-project
是你的项目名称 - 你当然可以根据需要命名它(composer将创建具有此名称的目录并将所有Laravel5文件放在此目录中)Multi-step method
使用选项
Download ZIP
下载https://github.com/laravel/laravel/tree/develop将其解压缩到网络目录中
在解压缩ZIP文件的目录中运行
composer update
(不是composer install
)在浏览器中为项目运行URL时使用这两种方法(例如
http://localhost/projects/test-laravel-5-project/public
,具体取决于您的Web服务器设置),您将获得标准的Laravel网站You have arrived.
两种方法都应该运作良好 . 尝试任何一个,以最适合您的方式 .
转到CLI并输入以下命令行 . 确保已安装composer .
$composer create-project laravel/laravel <yourdirectryname> dev-develop
它会问你关于删除.git文件的问题然后输入Y.将目录更改为$cd <yourdirectoryname>
然后输入以下命令$ php artisan -V
您将能够看到以下消息 .
Laravel Framework 5.0-dev意味着您已经成功安装了laravel 5!
从要存储项目的位置运行此命令
请记住,它将从git下载最新版本的laravel应用程序 .
如果您正在使用Linux,则通过从laravel项目的根目录运行命令
chmod 777 -R <dir name>
来授予 bootstrap/cache 和 storage 的权限