<commit_before>Installing symfony
==================

Overview
--------

This chapter describes the steps to install the symfony framework, either from a 'sandbox' archive, from a PEAR package or manually from the source repository.

Introduction
------------

The symfony framework is a set of files written in PHP. A project based on symfony uses these files, so installing symfony means getting these files and making them available for your project.

Symfony can be used for one or many projects. If you work on a single project, you may want to embed the framework within the application you develop. On the other hand, if you choose to use symfony for more than one project, you will prefer to keep all the symfony files in one single place to make the upgrade easier. 

In addition, when developing an application, you will probably need to install symfony twice: Once for your development environment, and once for the host server (unless your hosts already has symfony installed).

All these different needs have different answers, that's why you have several alternatives to install symfony:

- The **sandbox** is an empty symfony project where all the required libraries are already included, and where the basic configuration is already done. It is made mostly for symfony beginners, who want to play with the framework or try the tutorials without installing anything.
- The **PEAR installation** is recommended to those who want to run several symfony-based projects, with an easy way to upgrade. It requires PEAR version 1.4.0 or higher, which is bundled in most PHP distributions.
- The **manual installation** is meant to be used only by advanced PHP developers, who what to take advantage of the latest patches or add features of their own.

Note that the symfony framework evolves quickly, and that a new stable version can come out only a few days after your first installation. You have to think of the framework upgrade as a major concern, and that's why the first solution is not recommended if you develop a website for real. In fact, an application developed with the sandbox can not be upgraded easily.

Prerequisites
-------------

In order to use symfony, you need to have PHP5 and a web server installed. If you want to use the PEAR install, you will also need [PEAR][1]. If you plan on using persistent data, a database will be needed. Symfony is compatible with MySQL, PostgreSQL, Oracle, MSSQL, and any other database having a [Creole](http://creole.phpdb.org/wiki/) driver.

>**Note**: You can find many [LAMP](http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29) packages offered for download, which contain the Apache server, the MySQL database and PHP all bundled together and configured for a given platform ([XAMPP](http://www.apachefriends.org/en/xampp.html) for many platforms, [MAMP](http://www.mamp.info/en/home/) for Macintosh, [WAMP](http://en.wikipedia.org/wiki/WAMP) for Windows, etc.). If you don't have PHP5 installed, they are probably the best option for you to start.

The standard distributions of PHP5 normally work perfectly with symfony. However, as all the installations are different, and because many of the developers compile PHP themselves, it sometimes happens that your web server throws errors because of missing components in PHP. If you can't manage to get symfony working, check out the [installation forum](http://www.symfony-project.com/forum/index.php/f/6/), where many individual cases were solved and can help to solve yours.

>**Note**: Some packages sometimes embed both PHP4 and PHP5. Symfony only works with PHP5. To check the version of PHP that you are using, type in a command line:
>
>         $ php -v
>

The sandbox
-----------

The sandbox is a simple archive of files. It contains an empty symfony project where all the required libraries	(symfony, pake, creole, propel and phing) are already included. To install it, just unpack the archive under the root web directory configured for your server (usually	`web/`). It will work "out of the box", without configuration or any additional package.

The sandbox is intended for you to practice with symfony in a local computer, not really to develop complex applications that may end up on the web. However, the version of symfony shipped with the sandbox is fully functional and equivalent to the one you can install via PEAR. Beware that the sandbox is not easily upgradeable.

Get the sandbox here: [http://www.symfony-project.com/get/sf_sandbox.tgz](http://www.symfony-project.com/get/sf_sandbox.tgz). After unpacking the archive, test the sandbox by requesting the following URL:
    
    http://localhost/sf_sandbox/web/
    
You should see a congratulations page.

f you are in the `sf_sandbox/` directory, you can use the command line to do usual site management operations. For instance, to clear the cache, type:

    $ ./symfony.sh clear-cache                      (*nix)<commit_msg>* Updated URL to creole site (previously a broken link).<commit_after>Installing symfony
==================

Overview
--------

This chapter describes the steps to install the symfony framework, either from a 'sandbox' archive, from a PEAR package or manually from the source repository.

Introduction
------------

The symfony framework is a set of files written in PHP. A project based on symfony uses these files, so installing symfony means getting these files and making them available for your project.

Symfony can be used for one or many projects. If you work on a single project, you may want to embed the framework within the application you develop. On the other hand, if you choose to use symfony for more than one project, you will prefer to keep all the symfony files in one single place to make the upgrade easier. 

In addition, when developing an application, you will probably need to install symfony twice: Once for your development environment, and once for the host server (unless your hosts already has symfony installed).

All these different needs have different answers, that's why you have several alternatives to install symfony:

- The **sandbox** is an empty symfony project where all the required libraries are already included, and where the basic configuration is already done. It is made mostly for symfony beginners, who want to play with the framework or try the tutorials without installing anything.
- The **PEAR installation** is recommended to those who want to run several symfony-based projects, with an easy way to upgrade. It requires PEAR version 1.4.0 or higher, which is bundled in most PHP distributions.
- The **manual installation** is meant to be used only by advanced PHP developers, who what to take advantage of the latest patches or add features of their own.

Note that the symfony framework evolves quickly, and that a new stable version can come out only a few days after your first installation. You have to think of the framework upgrade as a major concern, and that's why the first solution is not recommended if you develop a website for real. In fact, an application developed with the sandbox can not be upgraded easily.

Prerequisites
-------------

In order to use symfony, you need to have PHP5 and a web server installed. If you want to use the PEAR install, you will also need [PEAR][1]. If you plan on using persistent data, a database will be needed. Symfony is compatible with MySQL, PostgreSQL, Oracle, MSSQL, and any other database having a [Creole](http://creole.phpdb.org/trac/) driver.

>**Note**: You can find many [LAMP](http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29) packages offered for download, which contain the Apache server, the MySQL database and PHP all bundled together and configured for a given platform ([XAMPP](http://www.apachefriends.org/en/xampp.html) for many platforms, [MAMP](http://www.mamp.info/en/home/) for Macintosh, [WAMP](http://en.wikipedia.org/wiki/WAMP) for Windows, etc.). If you don't have PHP5 installed, they are probably the best option for you to start.

The standard distributions of PHP5 normally work perfectly with symfony. However, as all the installations are different, and because many of the developers compile PHP themselves, it sometimes happens that your web server throws errors because of missing components in PHP. If you can't manage to get symfony working, check out the [installation forum](http://www.symfony-project.com/forum/index.php/f/6/), where many individual cases were solved and can help to solve yours.

>**Note**: Some packages sometimes embed both PHP4 and PHP5. Symfony only works with PHP5. To check the version of PHP that you are using, type in a command line:
>
>         $ php -v
>

The sandbox
-----------

The sandbox is a simple archive of files. It contains an empty symfony project where all the required libraries	(symfony, pake, creole, propel and phing) are already included. To install it, just unpack the archive under the root web directory configured for your server (usually	`web/`). It will work "out of the box", without configuration or any additional package.

The sandbox is intended for you to practice with symfony in a local computer, not really to develop complex applications that may end up on the web. However, the version of symfony shipped with the sandbox is fully functional and equivalent to the one you can install via PEAR. Beware that the sandbox is not easily upgradeable.

Get the sandbox here: [http://www.symfony-project.com/get/sf_sandbox.tgz](http://www.symfony-project.com/get/sf_sandbox.tgz). After unpacking the archive, test the sandbox by requesting the following URL:
    
    http://localhost/sf_sandbox/web/
    
You should see a congratulations page.

f you are in the `sf_sandbox/` directory, you can use the command line to do usual site management operations. For instance, to clear the cache, type:

    $ ./symfony.sh clear-cache                      (*nix)
{'fraction_non_alphanumeric': 0.06667340135367208, 'fraction_numerical': 0.0030306091524396404, 'mean_word_length': 4.12157268494568, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 10, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1536007', 'n_tokens_mistral': 2453, 'n_tokens_neox': 2361, 'n_words': 1454}