laravel 5 中的空白页

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/29620078/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 11:21:02  来源:igfitidea点击:

blank page comes in laravel 5

phplaravelframeworks

提问by Arya

i have setup a newly laravel 5 in my UBUNTU system which is 14.04.

我在 14.04 的 UBUNTU 系统中设置了一个新的 Laravel 5。

when i ran my project which is http://localhost/blog/public/it give me a blank page. i have again and again setup laravel in my system but it not working.

当我运行我的项目http://localhost/blog/public/ 时,它给了我一个空白页面。我一次又一次地在我的系统中设置了 laravel,但它不起作用。

i know "php artisan serve". it will run my project on http://localhost:8000/but i don't want this. i want to run simply by entering a url. please help me and thanks a lot for your solutions.

我知道“php artisan serve”。它将在http://localhost:8000/上运行我的项目,但我不想要这个。我只想通过输入一个 url 来运行。请帮助我,非常感谢您的解决方案。

回答by Arya

Run below command on your project directory.

在您的项目目录上运行以下命令。

sudo chmod -R 777 storage/

after this its might be working fine.

在此之后,它可能工作正常。

回答by Kent Aguilar

You could try any of these pointers.

您可以尝试任何这些指针。

  • Give write permission to bootstrap/cache and storage folders
  • 授予对引导程序/缓存和存储文件夹的写入权限

sudo chmod -R 777 bootstrap/cache storage

sudo chmod -R 777 引导程序/缓存存储

  • Generate new application key via the artisan command
  • 通过 artisan 命令生成新的应用程序密钥

php artisan key:generate

php工匠密钥:生成

  • If the blank screen still persists, and you're running on CENTOS, then it's potentially be a SELinux issue. If so, run this command.
  • 如果黑屏仍然存在,并且您在 CENTOS 上运行,则可能是 SELinux 问题。如果是,请运行此命令。

setenforce permissive

强制许可


Hope this helps!


希望这可以帮助!

回答by Abhijeet Navgire

Give write permission to bootstrap/cache & storage folder by using below command

使用以下命令授予对引导程序/缓存和存储文件夹的写入权限

sudo chmod -R 777 bootstrap/cache

sudo chmod -R 777 storage

also make sure new application key generate. if not then use below command

还要确保生成新的应用程序密钥。如果没有,则使用以下命令

php artisan key:generate