问题
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