Learn to create Symfony project (php) in windows easily

How to create a symfony (2 or 3) project in windows

Symfony is a framework, a set of tools and a development methodology. Beyond the tools, Symfony is also a Philosophy and a Community.

Now that you've decided to use one of the best PHP frameworks to accelerate your development, if you're using windows you may not understand how to create a project correctly.

Since symfony 2 , SensioLabs decided to create a symfony installer to make the creation of a symfony project easier and dynamic, first we need the symfony.phar file (the symfony installer, you can read more about the installation here) .

You need to have a PHP distribution installed in your windows machine. 

cd C:/thepath/where/you-want-your-project

# Important, do not add the name of the project folder, because symfony.phar will create it
  • Copy the path where your php executable is located and the path of the symfony.phar now execute the comand of the symfony installer to create a project :
# the following line will do the trick for you

C:\pathtothephpexecutable\php.exe C:\mypathtosymfony.phar\symfony.phar new theNameOfMyProject

# This will create a folder with the name "theNameOfMyProject" where you are located with the cmd.exe (step 3)

If you want you can download an specific version of symfony, read the symfony download documentation, remember , in windows we replaced the symfony keyword in the console replacing all with the path of the php executable and the symfony.phar path and then the commands.

Important: According to your windows version,if the previous commands didn't work, you may need to wrap every executable path with double quotes, for example :

"C:\thepathtothephpexecutable\php.exe" "C:\thepathtothesymfony-pharfile\symfony.phar" new "TheNameOfMyProject"

Have fun !


Senior Software Engineer at Software Medico. Interested in programming since he was 14 years old, Carlos is a self-taught programmer and founder and author of most of the articles at Our Code World.

Sponsors