Symfony vendor autoload_runtime
When I try to do : symfony console d:d:c
to initiate my database I have :
Parse error: syntax error, unexpected '?' in C:\Users\user\my_project_name\vendor\autoload_runtime.php on line 21 exit status 255
Here is the autoload_runtime file :
// autoload_runtime.php @generated by Symfony Runtime
if (true === (require_once __DIR__.'/autoload.php') || empty($_SERVER['SCRIPT_FILENAME'])) {
return;
}
if (PHP_VERSION_ID < 80000 && in_array(PHP_SAPI, ['cli', 'phpdbg'], true)) {
ob_start();
$app = require $_SERVER['SCRIPT_FILENAME'];
ob_end_clean();
} else {
$app = require $_SERVER['SCRIPT_FILENAME'];
}
if (!is_object($app)) {
throw new TypeError(sprintf('Invalid return value: callable object expected, "%s" returned from "%s".', get_debug_type($app), $_SERVER['SCRIPT_FILENAME']));
}
$runtime = $_SERVER['APP_RUNTIME'] ?? 'Symfony\\Component\\Runtime\\SymfonyRuntime';
$runtime = new $runtime(($_SERVER['APP_RUNTIME_OPTIONS'] ?? []) + [
'project_dir' => dirname(__DIR__, 1),
]);
[$app, $args] = $runtime
->getResolver($app)
->resolve();
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
I don't know where the problem is, can someone help please ?
NB : I put a .php-version in my symfony project with my current version inside and it works.
Question done !
Your PHP doesn't understand the "null coalesce operator" ??
, that was introduced in PHP 7, that means you're using a PHP 5.x version.
The current version of Symfony (5.3) requires PHP 7.2.5 or higher. (but php7.2 is already end of life, you should upgrade to PHP 7.4 or 8.0)