尝试访问数组偏移量类型为 null 的值...使用 PHP 7.4,Symfony:

问题描述

尝试访问 /var/www/html/symfonyproject/src/AppBundle/Controller/ 中类型为 null 的值的数组偏移量(从“/var/www/html/symfonyproject/app/config/routing”导入.yml”)。

解决方法

我在 PHP 7.4.3 版中安装了 Symfony 并出现此错误,我添加了 PHP 7.4.3 版 composer.json 然后 Composer 更新工作正常。

步骤 1 - 在 composer.json 中添加 Composer 版本

第 2 步 - 作曲家更新