Laravel在初始化时崩溃,错误为500(无其他信息) [英] Laravel crash on init with error 500 (no additional info)

查看:66
本文介绍了Laravel在初始化时崩溃,错误为500(无其他信息)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将应用程序部署到共享主机时遇到一些问题.

I have some problems with deploying app to a shared host.

我到目前为止所做的事情:

What i did till now:

  • 将所有公共文件复制到public_html/website/my-api
  • 将所有laravel系统文件复制到public_html/laravel
  • 已检查的权利
  • 将my-api/index.php require和require_once改正为laravel/bootstrap/autoload.php
  • laravel日志为空,没有数据
  • apache日志为空,没有数据
  • 我的虚拟主机是Hetzner托管

经过调试后,它在此处崩溃:

After some debugging it crashes here:

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);

我收到错误500,但没有其他信息.我再次检查正确,以此类推.它们是777.只是崩溃,错误500.

I get Error 500 and no other information. I double checked right etc. they are 777. It's just crash with error 500.

我检查了.php版本,并且在localhost上可以在5.6.25上运行,而在5.6.35上进行了测试,也可以.

I checked .php version and on localhost it works with 5.6.25 i tested with 5.6.35 and it's ok too.

我会进一步调查.它似乎在Application.php :: 207行崩溃

I investigate it further. It seems to crash at Application.php ::207 line

$this->make($bootstrapper)->bootstrap($this);
$bootstrapper has value -> "Illuminate\Foundation\Bootstrap\RegisterProviders"

如果有人知道更多.

推荐答案

我发现我的应用程序中的路径不正确.

I found out that paths in my App were incorrect.

它是在Windows上开发的,因此路径文件夹是\,但是在迁移到生产服务器(Linux)之后无法打开任何东西.因此,使用\->/更改应用程序的自定义包含(require_one调用)

It was developed on windows so path folders were \ but than after migrating to production server (Linux) could not open anything. So changing my custom includes (require_one calls) with \ -> / finally app worked

检查后出现此错误

public function render($request, Exception $exception) in my App/Exception/Handler.php

并放入var_dump($ exception)最终打印出了什么情况.如果这对其他人有帮助.

and putting var_dump($exception) finally printed what was going on. If it will help to anybody else.

感谢回答: https://stackoverflow.com/a/32714318/1861519 指出了异常处理程序.

Thanks to answer: https://stackoverflow.com/a/32714318/1861519 which pointed me to a Exception handler.

另一个提示,对于共享托管,如果没有SSH(运行artisan/composer),请检查laravel/bootstrap/cache/config.php那里的路径不正确.

One more hint, for a shared hosting if you don't have SSH (to run artisan/composer), check laravel/bootstrap/cache/config.php Paths were incorrect there.

非常感谢: https://stackoverflow.com/a/33652169/1861519 正确配置custum公用文件夹.

Big thanks got to: https://stackoverflow.com/a/33652169/1861519 For right configuration of custum public folder.

这篇关于Laravel在初始化时崩溃,错误为500(无其他信息)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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