Reputation: 5602
$ 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"
Upvotes: 30
Views: 111357
Reputation: 2780
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/*
Upvotes: 0
Reputation: 5602
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.
Upvotes: 32
Reputation: 1708
If you use git - you should check if bin/console is added to repository. Some versions may have .gitignore in bin/ folder, so bin/console may work on your local PC and not work on server because of it.
Upvotes: 3
Reputation: 374
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 )
Upvotes: 4
Reputation: 81
Before to use this command make sure you installed dependencies from composer.json
Run:
composer update
Upvotes: 6
Reputation: 489
It works when I use start instead of run : php app/console server:start
Upvotes: 3
Reputation: 316
The file app/console was moved to bin/console in Symfony 3. So instead of running
php bin/console server:run #valid in Symfony 3
Try running:
php app/console server:run #valid in Symfony 2
Upvotes: 11