laravel public/index.php - 哎呀,好像出了点问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/50522082/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
laravel public/index.php - Whoops, looks like something went wrong
提问by futur1st
i just installed Laravel (throught composer):
我刚刚安装了 Laravel(通过作曲家):
OS - Windows 8;
Local Server - Open Server;
When i go to "tlaravel.loc/"i get the core folder with all directories:
当我转到“tlaravel.loc/”时,我得到了包含所有目录的核心文件夹:
If i go to http://tlaravel.loc/public/ i get 500 error and: Whoops, looks like something went wrong.
如果我去的http://tlaravel.loc/公共/我得到500错误:哎呀,看起来像出事了。
After modify rights (maked writable) for next directories: - public - bootstrap/cache - storage i resolved the problem with 500 eror, but on the page is still the error: Whoops, looks like something went wrong.
修改下一个目录的权限(使可写)后: - 公共 - 引导程序/缓存 - 存储我解决了 500 错误的问题,但页面上仍然是错误:哎呀,看起来好像出了点问题。
回答by Rajesh kumar
Now you've need to run these commands:-
现在你需要运行这些命令:-
For generate env key-
用于生成环境密钥-
php artisan key:generate
And after that
在那之后
composer update
It'll resolve yours issue.
它会解决你的问题。
回答by Thomas Rogers
The Upper answer is totally right, I'll explain it better what do you have to do in order to fix this problem
上面的答案是完全正确的,我会更好地解释它你必须做什么才能解决这个问题
In your laravel project that you've installed, you have all of these folders and files in the root directory, as you can see... there's an .env.example
file in the root folder
在您安装的 Laravel 项目中,根目录中有所有这些文件夹和文件,如您所见…….env.example
根文件夹中有一个文件
WINDOWS... maybe other OS DOES NOTunderstand/recognize what the heck is that for, but they need an enviroment file in the root folder in order to get the key that allows us to open the local server.
WINDOWS ......也许其他操作系统不理解/识别那到底是什么,但他们需要根文件夹中的环境文件才能获得允许我们打开本地服务器的密钥。
so what we have to do is to rename that file .env.example
to just .env
.
所以我们要做的就是将该文件重命名.env.example
为.env
.
after that you have to try again putting in the shell/terminal:
之后,您必须再次尝试放入外壳/终端:
php artisan key:generate
and then....
进而....
composer update
after that you run your server again and it will work!!!!
之后你再次运行你的服务器,它会工作!!!!