Symfony4部署执行symfony_requirements报错,是否需改用app/console?
Hey there! Let's sort out this deployment issue you're facing.
First off, Symfony 4 completely removed the bin/symfony_requirements script that existed in older versions (like Symfony 2/3). Also, the old app/console command was renamed to bin/console starting from Symfony 4, so you won't find app/console in your Symfony 4 project at all.
Here's what you can do instead to check your server environment meets Symfony's requirements:
Use the built-in
aboutcommand: Symfony 4 (and later) includes environment checks directly in the console. Run this command:php bin/console aboutThis will display a detailed overview of your project's environment, including a clear section showing whether all Symfony requirements are satisfied.
Install the standalone requirements checker: If you prefer a dedicated tool for this task, you can install the
symfony/requirements-checkerpackage via Composer:- First, add the package (it's recommended to install it as a dev dependency):
composer require symfony/requirements-checker --dev - Then run the checker script:
php vendor/bin/requirements-checker
- First, add the package (it's recommended to install it as a dev dependency):
Just a quick note: Symfony 4+ uses a streamlined project structure compared to older versions, so always make sure you're referencing the correct version of the official docs when deploying—this will save you from similar mismatches down the line!
内容的提问来源于stack exchange,提问作者aserra

