Installing a Symfony2 Distribution

  • Symfony2 packages "distributions", which are fully-functional applications that include the Symfony2 core libraries, a selection of useful bundles, a sensible directory structure and some default configuration.

  • When you download a Symfony2 distribution, you're downloading a functional application skeleton that can be used immediately to begin developing your application.

  • Start by visiting the Symfony2 download page at http://symfony.com/download.

  • On this page, you'll see the Symfony Standard Edition, which is the main Symfony2 distribution.

  • There are 2 ways to get your project started:

    Option 1) Composer Composer is a dependency management library for PHP, which you can use to download the Symfony2 Standard Edition. Start by downloading Composer anywhere onto your local computer. If you have curl installed, it's as easy as:

    curl- https://getcomposer.org/installer | php

    Composer is an executable PHAR file, which you can use to download the Standard Distribution:

    $ php composer.phar create-project symfony/framework-standard-edition /path/to/webroot/ Symfony 2.3.0

    For an exact version, replace "2.3.0" with the latest Symfony version. For more details, see the Symfony Installation Page. To download the vendor files faster, add the --prefer-dist option at the end of any Composer command.

    This command may take several minutes to run as Composer downloads the Standard Distribution along with all of the vendor libraries that it needs. When it finishes, you should have a directory that looks something like this:
    path/to/webroot/ <- your web server directory (sometimes named htdocs or public)
    Symfony/ <- the new directory
    app/
    cache/
    config/
    logs/
    src/
    ...
    vendor/
    ...
    web/
    app.php
    ...
    
    Option 2) Download an Archive

    You can also download an archive of the Standard Edition. Here, you'll need to make two choices:

    • Download either a .tgz or .zip archive - both are equivalent, download whatever you're more comfortable using.

    • Download the distribution with or without vendors. If you're planning on using more thirdparty libraries or bundles and managing them via Composer, you should probably download "without vendors".