0

I have a command inside my command folder under my bundle folder. I'm trying to execute it using the windows command prompt or using netbeans. The documentation says to use the bin/console. But I have no idea what is that or how to use it. Please help.

4
  • symfony.com/doc/current/console/usage.html Commented Sep 29, 2016 at 22:44
  • All I get is: Could not open input file: bin/console Commented Sep 29, 2016 at 22:46
  • php bin/console assuming you have a path set to your php executable Commented Sep 29, 2016 at 22:56
  • 1
    depends on which version of symfony you are using. If its > 3.0 than it is php bin/console otherwise it is php app/console Commented Sep 30, 2016 at 7:44

1 Answer 1

2

in Symfony2, the console is located at /app/console

so if you cd to your application home directory, then run php app/console <name of command>

in the Command class, the name is set:

protected function configure()
{
    // to run the console command, use 'php app/console forex:update'
    $this->setName('forex:update')
         ->setDescription('Update Foreign Exchange Rates');
}

in the example above, the command to run it (from the application home directory is:

php app/console forex:update

You may also need to add the php to your PATH, or replace php with the path to your php executable.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.