$ cd my_project_name/
$ php bin/console server:run
When I added following commands and tried to run my symfony application this error comes,
"Error:Could not open input file: bin/console"
As @chapay and @cered says we can use this command instead.
php app/console server:run
Its Symfony 2 command and the one I had problems with is Symfony 3 command. And I found out few other times also this issue comes.
for sometimes we can replace 'bin' with 'app'. like,
php bin/console doctrine:mapping:import --force AcmeBlogBundle xml
php app/console doctrine:mapping:import --force AcmeBlogBundle xml
And if not we can choose the correct command in 'http://symfony.com/doc/' site by changing the version.
Before to use this command make sure you installed dependencies from composer.json
Run:
composer update
also make sure you are under the project folder (cd your_project), else it gives you the same error ( Could not open input file: bin/console )
In Symfony 6, somehow the bin folder is still ignored from git, even though it should be there.
You can check my other answer here: https://stackoverflow.com/a/73958225/9675721
/bin folder/config/packages folder as well.gitignore: !/bin/
!/config/packages/*
php app/console server:runinstead.