Recently I started working with Symfony2. Unfortunately the php app/console commands doesn't work at both my MAMP server as Vagrant server (MAC OSX). I tried to make a bundle with the following command
php app/console generate:bundle --namespace=Vendor/NameBundle
and also tried to fix a problem with
php app/console assets:install web
And both commands returned the following in my terminal:
Could not open input file: app/console
Does someone know how to fix this problem? I AM working at my project directory like: mac/applications/mamp/htdocs/project but it is still not working. I also tried to reinstall a new symfony project but that was not a fix. I guess my php isn't working at all in my terminal...
So the problem was the version number. Symfony version 3.0 is available now so if you're do not selecting a version number at your project install it will automaticly install version 3.0 instead of 2.7. The new command is:
$ php bin/console generate:bundle --namespace=Vendor/NameBundle
instead of
$ php app/console generate:bundle --namespace=Vendor/NameBundle
php
to your Path
Environment Variable so that you can execute php from the command linephp -version
to test whether php has successfully been added to your path
environment variablephp app/console
or php bin/console
where console
is a php file inside the app
or bin
directories in your project root. To check which command to use, look into your project directories, if bin/ directory is present then execute php bin/console
as console.php
is located in that directory.dir
command, if all your Symfony project directories: app/, bin/, src/, vendors/
etc. are displayed, then the php app/console (bin/console) ...
command should run successfully.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With