Php App\Exceptions\Handler::report(Throwable$exception)的Larvel错误声明

Php App\Exceptions\Handler::report(Throwable$exception)的Larvel错误声明,php,laravel,Php,Laravel,我使用的是Laravel 6,在部署到运行PHP 7.3的共享主机时出现以下错误: App\Exceptions\Handler::report(Throwable $exception) App\Exceptions\Handler::report(Throwable$exception)的声明必须与第8行/home/kb2hm3y8r4wm/public_html/laravel.supremainimation.com/App/Exceptions/Handler.php中的light\

我使用的是Laravel 6,在部署到运行PHP 7.3的共享主机时出现以下错误:

App\Exceptions\Handler::report(Throwable $exception)
App\Exceptions\Handler::report(Throwable$exception)的声明必须与第8行/home/kb2hm3y8r4wm/public_html/laravel.supremainimation.com/App/Exceptions/Handler.php中的light\Foundation\Exceptions\Handler::report(exception$e)兼容


我认为您所得到的错误是由于对Laravel7(而不是6)的更改,正如您在上所看到的。选中此项:

  • 对于小于7的Laravel:

    应用程序的报告和呈现方法
    App\Exceptions\Handler
    类应接受
    异常
    接口而不是
    可丢弃的
    实例:

    使用异常;
    公共职能报告(例外$例外);
    公共函数呈现($request,Exception$Exception);
    
  • 对于Laravel>=7:

    应用程序的报告和呈现方法
    App\Exceptions\Handler
    类应接受
    Throwable
    接口而不是
    异常
    实例:

    使用一次性的;
    公共职能报告(一次性$exception);
    公共函数呈现($request,Throwable$exception);
    

它在我的本地服务器上工作,但当我在共享主机上满负荷工作时,它不工作,还有一件事我的artisan命令也不工作working@KamaljeetSingh检查
composer.json
文件上的
laravel/framework
版本,您的主机/服务器上是什么?@HaferDivandari我正在使用godaddy-ultimate托管aisa服务器“php”:“^7.2”,“cnvs/canvas”:“^5.2”,“fideloper/proxy”:“^4.0”,“水果蛋糕/laravel cors”:“^1.0”,“laravel/framework”:“^6.2”,“laravel/socialite”:“^4.3”,“laravel/tinker”:“^2.0”,“laravel/ui”:“^1.2”,“nesbot/carbon”:“^2.31每当我运行composer安装时,在cli中出现错误,我得到了“Script@php artisan package:discover--ansi处理自动加载后转储事件,返回错误代码255”谢谢!这帮助我修复了更新到lumen 7后出现的错误