How to execute symfony 3 commands in windows with the command prompt


As you may noticed, with the new symfony 3, the project structure has changed. The new folders are var (cache,logs and sessions are now located in this folder) and bin (the console file is now located in this folder). Therefore we need to change the path where the commands are targetting.

In netbeans we used to execute commands using the contextual menu of the symfony 2 projects :

Netbeans symfony commands

But with symfony 3, netbeans will not work (at less till a new update) for symfony 3 projects.

And without a graphic interface we used to execute in the command prompt :

php app/console generate:bundle

Executing commands

You need to be located in the project folder, therefore use cd command to locate yourself in the project folder :

cd c:/path-to-project/symfonyProjectFolder

Then execute a command as you always do, but simply change the console path using :

php bin/console generate:bundle

Remember to execute cmd.exe in administrator mode to prevent any misconfiguration in the process.

Windows symfony 3 commands

That's it ! Have fun !

Become a more social person