Handler.php第25行中的Laravel FatalErrorException [英] Laravel FatalErrorException in Handler.php line 25

查看:101
本文介绍了Handler.php第25行中的Laravel FatalErrorException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用PHP7的最新宅基地上进行Laravel 5.1项目时,偶尔会遇到以下错误

I'm getting the following error on random occasions, working on a Laravel 5.1 project on the latest homestead with PHP7

FatalErrorException in Handler.php line 25:
Uncaught TypeError: Argument 1 passed to App\Exceptions\Handler::report() must be an instance of Exception, instance of TypeError given, called in /home/vagrant/Code/henau/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php on line 73 and defined in /home/vagrant/Code/henau/app/Exceptions/Handler.php:25
Stack trace:
#0 /home/vagrant/Code/henau/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(73): App\Exceptions\Handler->report(Object(TypeError))
#1 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleException(Object(TypeError))
#2 {main}
thrown

即使我撤消了引起它的工作,它仍然存在.这是由该实例中的这段代码引起的

Even when I undo work that has been causing it, It stays. It's being caused by this block of code in this instance

\Mail::send('emails.registered', $user, function ($m) {
    $m->to('miguel@dummyaddress.com')->subject('New Order');
});

在我看来,该错误与代码没有直接关系.我见过其他人在完全不同的情况下遇到它.我已经看到它在有关Homestead和PHP7的旧线程中弹出.有一个askubuntu主题,但它处于脱机状态,所以我希望我们可以在这里重新开始讨论.

It seems to me the error is not directly code-related. I've seen other people encounter it in complete different situations. And i've seen it popup in older threads regarding Homestead and PHP7. There was an askubuntu thread but it's offline, So I hope we can reopen the discussion here.

推荐答案

解决方案

这实际上是一个错误,无法显示异常.这是由于在需要PHP5.6.x的较旧的Laravel项目上使用PHP7.x引起的.

Solution

This is actually an error that an exception can't be shown. This is caused by using PHP7.x on an older Laravel project that requires PHP5.6.x

我的解决方案是为该项目创建一个新的Homestead,并使用较旧的laravel/homestead版本在该宅基上安装php5.6

My solution was to create a new Homestead specific for this project and install php5.6 on that homestead using an older version of laravel/homestead

这篇关于Handler.php第25行中的Laravel FatalErrorException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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