Laravel 500 错误没有日志 [英] Laravel 500 error no logs

查看:35
本文介绍了Laravel 500 错误没有日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,根据stackoverflow,当bootstrap/cachestorage 目录的权限有问题时,就会出现这个问题.我尝试了几乎所有的建议,但都没有运气.

First of all, according to stackoverflow, this problem occurs when something is wrong with permissions of bootstrap/cache and storage directories. And I tried literally every advice on that with no luck.

我很高兴在我的旧笔记本电脑上使用 Xubuntu 16.04,开发了一个项目.使用 docker-compose 搭建开发环境.昨天我买了全新的 PC,安装了 Kubuntu 18.04,安装了 docker 以及我需要工作的一切.

I was happy user of Xubuntu 16.04 at my old laptop, developed one project. Using docker-compose to set up development environment. Yesterday I bought brand new PC, installed Kubuntu 18.04, installed docker and everything I need to work.

克隆仓库,运行composer installdocker-compose up,然后php artisan migratephp artisan storage:link.但是当我尝试在浏览器中打开网站时,我收到 500 错误,并显示空体响应.

Cloned repository, ran composer install, docker-compose up, then php artisan migrate and php artisan storage:link. But when I try to open website in browser, I get 500 error with empty body response.

APP_DEBUG 设置为 true.

APP_DEBUG is set to true.

6 小时后,我来到这里,结果几乎为零.尝试了在这里和论坛上找到的数十种解决方案(只是示例).

6 hours later I'm here with literally zero results. Tried dozens of solutions found here and on forums (just example).

我什至做了一个小实验:从我的旧笔记本电脑中删除项目目录,从头开始克隆它,安装所有需要的东西并且它工作正常.没有任何权限问题.

I even did a little experiment: removed project directory from my old laptop, cloned it from scratch, installed everything required and it worked. Without any permission problem.

更让我失望的是:docker 容器中没有日志,laravel 目录中没有日志,什么都没有.

And what kills me more: there are no logs inside docker containers, no logs inside laravel directory, just nothing.

请帮忙!怎么了?也许是库本图?也许是 18.04?也许是较新的 docker 版本?

Please help! What's wrong? Maybe it's Kubuntu? Maybe it's 18.04? Maybe it's newer docker version?

附言现在 bootstrap/cachestorage 目录归 alex:alex 所有,有 775 个权限.和我的笔记本电脑完全一样.

P.S. Right now bootstrap/cache and storage directories are owned by alex:alex and has 775 permissions. Exactly same as at my laptop.

推荐答案

添加 dd($exception->getMessage());异常处理程序类 就在第 37 行之前.运行请求并检查响应.

Add a dd($exception->getMessage()); to the exception handler class right before line 37. Run the request and check the response.

如果这没有任何作用,请通过检查访问和错误日​​志来验证请求是否正在访问网络服务器.也可以使用 dmesg 和类似工具检查系统日志.

If that doesn't avail anything, verify the request is hitting the webserver by checking access and error logs. Check system logs also using dmesg and similar.

既然您提到了 Docker,如果您使用的是 nginx,请确保在运行 docker-compose up 时不会覆盖您的站点配置.

Since you mention Docker, if you're using nginx, be sure your site configuration is not being overwritten when running docker-compose up.

这篇关于Laravel 500 错误没有日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆