Symfony 4 : Default value for parameters with a class type can only be

廉价感情. 提交于 2019-12-24 09:41:20

问题


I am currently working on an application in symfony 4. I encounter a problem for deploy in prod. when I get to the navigator I get this error :

Fatal error: Default value for parameters with a class type can only be NULL in /var/www/html/project/vendor/symfony/config/ResourceCheckerConfigCache.php on line 40.

public function __construct(string $file, iterable $resourceCheckers = array())
{
    $this->file = $file;
    $this->resourceCheckers = $resourceCheckers;
}

I specify that the site works perfectly with the dev server (php bin /console server:start)

The problem must come from the environment. in the .env file, when I set APP_ENV=dev , in the browser there is only a blank page with a status 500 (no message in the logs)

I can not find any documentation on the internet and I am starting to lack ideas. If someone has a solution I am interested.

Thank you.


回答1:


Solution by OP.

The problem was that the PHP version was PHP 7.0 and not 7.1. Though in my shell the php -v command was fine with 7.1, I noticed the wrong version used by phpinfo ();



来源:https://stackoverflow.com/questions/48348650/symfony-4-default-value-for-parameters-with-a-class-type-can-only-be

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!