Symfony2 custom console command appears as “not defined” upon execution

899 views Asked by At

Please help, I've tried everything;

The command works well on the development server, but not on live.

Before you mark it as duplicate:

  • The filename ends with Command.php
  • The Bundle is registered
  • The command is ContainerAware
  • The command is in the Bundle\Command directory and in the App\Bundle\Command namespace

I have tried:

  • clearing and warming up the cache on the server multiple times using the symfony console php console --env=preprod cache:clear and php console --env=preprod cache:warmup
  • listing available commands by calling the console without extra arguments php console --env=preprod

Is there any other way to force symfony to re-check available commands ?

1

There are 1 answers

1
zedling On

For future reference:

The problem was that I connected to the remote host before deploy, and bash doesn't update symlink targets.

So the Command was not available in my current working directory.

A simple cd .., cd current solved it.