Zoha Ali Khan
Zoha Ali Khan

Reputation: 1699

Could not open input file app/console

I installed wamp server and a copy of the Symfony2 framework. I am trying to create a Bundle, using the following command:

php app/console generate:bundle --nampespace=IDP/IDP_Bundle --format=yml

My PHP is in C:/wamp/bin/php/php5.3.10

But when I run the command it says:

could  not open input file app/console

Can anyone tell me what is going wrong?

Upvotes: 23

Views: 72380

Answers (9)

Carlos Perez Perez
Carlos Perez Perez

Reputation: 407

It is also possible that you have the line :

//umask(0000);

in your /web file, app_dev.php.

If after doing :

php app/console generate:bundle --nampespace=IDP/IDP_Bundle --format=yml

in your project path, you still can not generate your bundle, try uncommenting the unmask line. It worked for me.

Upvotes: 0

Lahiru Pinto
Lahiru Pinto

Reputation: 1681

I got the same issue when installing the pear library

my issue was, when downloading the go-pear.phar file, it downloads as the (.txt) extension which i didn't see.

jst change the file extension to .phar and run the code

Upvotes: 0

juanitourquiza
juanitourquiza

Reputation: 2194

I'm use Symfony 3 and the Bundle calendar-bundle. This error is present in the documentation of: Bundle: https://github.com/adesigns/calendar-bundle

The form correct is:

php bin/console assets:install web 

Regards

Upvotes: 3

pavan ganvani
pavan ganvani

Reputation: 102

First check the Environment Variable which is in Advanced system setting -> set path of C:/wamp/www/bin/php and then

run cmd->go to the directory of your project which is in www folder using cd C:/wamp/www/yourproject

use then user php app/console that shows the all command.

Upvotes: 1

Parixit
Parixit

Reputation: 3855

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.

Upvotes: 44

Imran Zahoor
Imran Zahoor

Reputation: 2787

For newer versions of Symfony (2.4.x or newer) use this method on windows to resolve the problem:

  1. Go to project directory e.g. d:/xampp/symfony2-project/ and open composer.json and place this under requires array "symfony/console": "2.4.*@dev". And save the file.
  2. Open command-line and cd to project's directory.
  3. Use this command to let download and install the dependencies: php path/to/composer.phar install. Remember you should be in your project's directory and path/to/composer.phar is the actual path to your composer.phar file.
  4. Now you are all done, just use php bin/console generate:bundle --namespace=Test/PrintBundle --format=yml

Upvotes: 8

Faryal Khan
Faryal Khan

Reputation: 869

Dont run the command from the php path.

Add php into your path environment variable

and then cd to the project

C:/wamp/www/yourproject

and then run the command

php app/console generate:bundle --nampespace=IDP/IDP_Bundle --format=yml

It will work

Upvotes: 23

Zoha Ali Khan
Zoha Ali Khan

Reputation: 1699

Actually You need to be in your project root to run this command and you have to add php directory to your system env path variable.

  1. Add your php directory to the system path variable
  2. cd to the root of your project

Upvotes: 3

Peter Bailey
Peter Bailey

Reputation: 105888

Sounds like you (i.e., your user) don't have access to read/execute console. I've never worked with with file permissions on a WAMP stack so I'm not sure what you'll need to do to fix them.

Upvotes: 0

Related Questions