laravel ErrorException 尝试访问类型为 null 的值的数组偏移量

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

ErrorException Trying to access array offset on value of type null

phplaravel

提问by Tech Studeo

I moved my laravel application to a new hosting account and I have been getting this error since then

我将我的 Laravel 应用程序移到了一个新的托管帐户,从那时起我就一直收到此错误

ErrorException Trying to access array offset on value of type null

The email validator bro I guess.

我猜是电子邮件验证器兄弟。

I don't know if anyone has experience this kind of issue after moving a laravel website.

不知道有没有人在移动laravel网站后遇到过这种问题。

Please help!

请帮忙!

回答by Tech Studeo

The PHP Version is indeed the problem. On the previous host it was PHP 7.3 but the new one run 7.4 so it caused the problem.

PHP 版本确实是问题所在。在以前的主机上它是 PHP 7.3,但新主机运行 7.4,所以它导致了问题。

Now I have downgraded to PHP 7.3.1 and the application now works fine.

现在我已经降级到 PHP 7.3.1 并且应用程序现在可以正常工作了。

Thanks so much.

非常感谢。

回答by Majid Zohrabbeigi

Your problem was caused by a change to the php new version. If you do not know which page caused this error, you can use the Symfony test. Maybe this link will help you:

您的问题是由更改 php 新版本引起的。如果您不知道是哪个页面导致了这个错误,您可以使用 Symfony 测试。也许这个链接会帮助你:

https://symfony.com/doc/current/contributing/code/tests.html

https://symfony.com/doc/current/contributing/code/tests.html