5.1.11
https://learnku.com/docs/laravel/5.1/quickstart/1048
https://xueyuanjun.com/post/398
服务器配置
---
Apache
* 配置httpd-conf:php5_module
composer 安装laravel
---
composer create-project laravel/laravel book "5.1.*" --prefer-dist
laravel快速配置(下)
---
.evn
APP_ENV=local(当前环境)
APP_DEBUG=true(是否输出调试信息)
APP_KEY=W8zvEC79qgIogvhOOO3mf9yU7ybBKikd(加密字符串)
DB_CONNECTION=mysql
DB_HOST=127.0.0.1(数据库 Host,默认端口是:3306)
DB_DATABASE=homestead(database)
DB_USERNAME=homestead(username)
DB_PASSWORD=secret(password)
config/app.php
---
'timezone' => 'PRC',(时区)
'locale' => 'en',(当地语言)
'key' => env('APP_KEY', 'W8zvEC79qgIogvhOOO3mf9yU7ybBKikd'),(重复默认加密,与.evn保持一致)
config/database.php
---
'default' => env('DB_CONNECTION', 'mysql'),(默认数据库连接,可以在.evn里指定)
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
(避免出错,可以重复指定)
网友评论