简体   繁体   English

尝试运行 Laravel 项目时出错

[英]error when trying to run a Laravel project

I am just getting started with Laravel and I wanted to download and run a project from github, but after running the php composer install and php artisan serve commands and going to http://127.0.0.1:8000 , it says "500 Server Error".我刚刚开始使用 Laravel,我想从 github 下载并运行一个项目,但是在运行 php 作曲家安装和 php 工匠服务命令并转到http://127.0.0.1:8000服务器后,错误显示“5 ”。 Do you guys have any idea what I should do in order to be able to run it?你们知道我应该怎么做才能运行它吗?

Did you make an env file?你做了一个env文件吗? You need to make sure your framework is connected to the server.您需要确保您的框架已连接到服务器。 You should have an env.example file to copy from and it should look something like this你应该有一个 env.example 文件可以从中复制,它应该看起来像这样

DB_CONNECTION=mysql
DB_HOST="db"
DB_PORT=3306
DB_NAME=YOUR DATABASE NAME
DB_USERNAME=YOUR DATABASE USERNAME
DB_PASSWORD=YOUR DATABASE PASSWORD

Save it in your root directory as.env将其保存在您的根目录中 as.env

First Form.env File Make APP_DEBUG=true.(then you will find error instead of 500) If There is no vendor Folder than in Cmd Write Composer Update.首先 Form.env 文件 Make APP_DEBUG=true。(然后你会发现错误而不是 500)如果 There is no vendor Folder than in Cmd Write Composer Update。 Then try php artisan serve然后试试 php artisan serve

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM