PHP app\console wont work trying to create bundle for Symfony 2

13,522

Solution 1

To execute command you should move to root directory of your project in terminal/CMD.

Please note that in version 2.5 some changes has been made so command will not work with app/console

Note: From 2.5 app/console is replaced by bin/console.

Please check here for changes. Also check this for more details about difference.

Solution 2

Most probably, you're not in the symfony2 project directory.

  1. start the windows console as you're doing it (Start->Run->CMD)
  2. then move to the symfony2 project root directory with the command cd: "cd c:\htdocs\path\to\your\symfony2\project"
  3. then run the command from the tutorial

the thing is that the part of the command from the tutorial "app/console" means the path to the "console" script in the "app" directory of the symfony2 project.

Share:
13,522
Arizona2014
Author by

Arizona2014

Updated on November 21, 2022

Comments

  • Arizona2014
    Arizona2014 over 1 year

    I have installed Symfony2 on a Xampp server with PHP 5.3.8 and everything works ok ( the php, the symfony demo page ).

    I try to create my own helloWorld, as the tutorial says :

    php app/console generate:bundle --namespace=Acme/HelloBundle --format=yml

    I go Start->Run->CMD and put that line of code and it gives me back this :

    could not open input file : app/console

    I put the PHP directory to the System PATH but the problem persists.

    • Admin
      Admin over 11 years
      its working for me Next i created a new bundle as per symfony doc. php app/console generate:bundle --namespace=Acme/TestBundle But how to access the page (url) http:// localhost /newsf/web/app_dev.php/test/John