Symfony History

Started: 2005
License: MIT
PHP versions:
• Symfony 1.4: PHP 5.2.4+
• Symfony 2.0: PHP 5.3+
Symfony was produced in a French web development company, Sensio Labs, by Fabien Potencier. First it was used for the development of its own applications and then in 2005 it was released as an open source project. Its name was “symfony,” but it is sometimes capitalized (as we do in this book) in order to make it more distinct. Symfony was based on an ancient Mojavi MVC framework, with some inevitable influences from Ruby on Rails. It also integrated Propel Object-Relational Mapped and took advantage of the YAML Ain't Markup Language (YAML) serialization standard for configuration and data 48 modeling.The default object-relational mapping (ORM) solution has been later changed to Doctrine. Today Symfony is one of the leading web frameworks. It has a large active community and a lot of documentation—mainly free e-books. Symfony 2.0 is being released in late 2010. It offers various new features
and greatly enhanced performance.

Windows Installation

Apache is installed as a part of XAMPP, so you don't have to install it separately.

Linux Installation

You can get Apache for all flavors of Linux. The following command installs it for Ubuntu:

sudo aptitude install apache2 When you go to http://localhost/ in your browser welcome message is comming. Your installation is not done yet. You need to install the PHP5 engine and PHP5 module for the server:

sudo aptitude install php5 libapache2-mod-php5 Then restart Apache with following command:

sudo /etc/init.d/apache2 restart

MacOS Installation

Just as with Windows, Apache is installed with XAMPP on Mac OS.


All web applications need persistent data storage. The most widely used mechanisms are relational database
management systems (RDBMSs). They are not really perfectly matched for object-oriented web applications (this is further discussed in Chapter 3), but they are standard technologies used by most companies and by the frameworks.

Now let's focus on installing a database solution.


MySQL is one of the leading open source databases. First it was developed by a Swedish company, MySQL AB; then the company was bought by Sun Microsystems, which in turn was bought by Oracle Corporation in 2010. MySQL is equipped with innovative features such as triggers, views, replication, and stored procedures. It is written in C/C++, is multithreaded, and is among the fastest RDBMSs with client-server architecture. XAMPP includes MySQL, so you don't have to install it anymore on Windows and Mac OS. To install MySQL and PHP5 support under Ubuntu, type the following into the console:

sudo aptitude install mysql-server mysql-client php5-mysql The package manager will ask you if you want to set up a root password. Although such a password is strongly recommended for production environments, it is easier to develop our applications without this password. If you need to set it (for example, if phpMyAdmin wants it), you can do it any time with following command: sudo mysqladmin -u root password NEW_PASSWORD


Most databases are built on client-server architecture, in which the database is a standalone process of the operating system, and all applications need to establish connections with it. SQLite is completely different. It works as a statically or dynamically linked programming library that is embedded into applications, allowing communication with the database by function calls (which is much more efficient). This approach also removes the necessities of installation and administration. The whole database is stored in a single file with a mechanism of locking it for read and write operations. SQLite is light, but fast and capable. It is generally ACID-compliant (atomicity, consistency, isolation, durability), but the programmer must manually impose integrity constraints on data types; otherwise, it is possible to insert incorrect data types. SQLite lacks some features of heavier databases, such as views or triggers.

XAMPP also includes SQLite. To install both SQLite and PHP5 support under Ubuntu, just type the following: sudo aptitude install sqlite php5-sqlite


If you envy XAMPP users the phpMyAdmin application, you can install it now with following command:

sudo aptitude install phpmyadmin
It will automatically configure your Apache and MySQL database. You only need to include into /etc/apache2/ apache2.conf the following line:
Include /etc/phpmyadmin/apache.conf You can access phpMyAdmin at http://localhost/ phpMyAdmin.

Copyright @