Getting Started with symfony

Symfony Installation

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


About

You are currently reading "Getting Started with symfony" which is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported License license.

Tutorial Content

Master symfony

Be trained by SensioLabs experts (2 to 6 day sessions -- French or English).
trainings.sensiolabs.com

Books on symfony

Learn more about symfony with the official guides.
books.sensiolabs.com

L'audit Qualité par SensioLabs

200 points de contrôle de votre applicatif web.
audit.sensiolabs.com

Chapter Content

Project Directory

Symfony Installation

symfony training
Be trained by symfony experts
Feb 21: Köln (Getting Started with Symfony2 - English)
Feb 27: Köln (Mastering Symfony2 - English)
Mar 05: Köln (Web Development with Symfony2 - Deutsch)
Mar 05: Montreal (Web Development with Symfony2 - English)
Mar 05: Montreal (Getting Started with Symfony2 - English)
and more...

Search


powered by google
You are currently browsing "Getting Started with symfony" in English for the 1.2 version - Switch to language:
Creative Commons License This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.
This version of symfony is not maintained anymore.
If some of your projects still use this version, consider upgrading as soon as possible.

Project Directory

Before installing symfony, you first need to create a directory that will host all the files related to your project:

$ mkdir -p /home/sfproject
$ cd /home/sfproject

Or on Windows:

c:\> mkdir c:\dev\sfproject
c:\> cd c:\dev\sfproject

Windows users are advised to run symfony and to setup their new project in a path which contains no spaces. Avoid using the Documents and Settings directory, including anywhere under My Documents.

If you create the symfony project directory under the web root directory, you won't need to configure your web server. Of course, for production environments, we strongly advise you to configure your web server as explained in the web server configuration section.

Symfony Installation

Create a directory to host the symfony framework library files:

$ mkdir -p lib/vendor

Now, you need to install symfony. As the symfony framework has several stable branches, you need to choose the one you want to install by reading the installation page on the symfony website.

Go to the installation page for the version you have just chosen, symfony 1.2 for instance.

Under the "Download as an Archive" section, you will find the archive in .tgz or in .zip format. Download the archive, put it under the freshly created lib/vendor/ directory and un-archive it:

$ cd lib/vendor
$ tar zxpf symfony-1.2.2.tgz
$ mv symfony-1.2.2 symfony
$ rm symfony-1.2.2.tgz

Under Windows, unzipping the zip file can be achieved using Windows Explorer. After you rename the directory to symfony, there should be a directory structure similar to c:\dev\sfproject\lib\vendor\symfony.

If you use Subversion, it is even better to use the svn:externals property to embed symfony into your project in the lib/vendor/ directory, which benefits from the bug fixes made in the stable branch automatically:

http://svn.symfony-project.com/branches/1.2/

Check that symfony is correctly installed by using the symfony command line to display the symfony version (note the capital V):

$ cd ../..
$ php lib/vendor/symfony/data/bin/symfony -V

On Windows:

c:\> cd ..\..
c:\> php lib\vendor\symfony\data\bin\symfony -V

If you are curious about what this command line tool can do for you, type symfony to list the available options and tasks:

$ php lib/vendor/symfony/data/bin/symfony

On Windows:

c:\> php lib\vendor\symfony\data\bin\symfony

The symfony command line is the developer's best friend. It provides a lot of utilities that improve your productivity for day-to-day activities like cleaning the cache, generating code, and much more.

Project Setup »
« The Sandbox

Questions & Feedback

If you find a typo or an error, please register and open a ticket.

If you need support or have a technical question, please post to the official user mailing-list.