①在项目根目录放置.env文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
.env
app_name=laravel
app_env=local
app_key=
app_debug=true
app_log_level=debug
app_url=http: //localhost
db_connection=mysql
db_host=127.0.0.1
db_port=3306
db_database=homestead
db_username=homestead
db_password=secret
broadcast_driver=log
cache_driver=file
session_driver=file
session_lifetime=120
queue_driver=sync
redis_host=127.0.0.1
redis_password=null
redis_port=6379
mail_driver=smtp
mail_host=smtp.mailtrap.io
mail_port=2525
mail_username=null
mail_password=null
mail_encryption=null
pusher_app_id=
pusher_app_key=
pusher_app_secret=
|
②在项目目录下运行:
1
|
php artisan key:generate
|
该命令会生成app_key并写入到.env文件中,重新运行
希望本文所述对大家基于laravel框架的php程序设计有所帮助。
原文链接:https://blog.csdn.net/qq_39479575/article/details/78495703