Saturday, January 5, 2013

Installing Symfony2 on Centos 6

Symfony2 framework looks like it provide many useful development tools.

All following codes require access to internet to download the respective files.

Pre installation check list for Symfony2.1.

  1. Installed and running Apache httpd
  2. Installed php 5.3 or higher
  3. Installed GIT 1.7 or higher
Install PHP
Lots of resources available online.

Ensure additional php packages are installed, including
  • php-cli
  • php-intl
  • php-mysql (if you use MySQL database)
  • php-gd
  • php-pecl-apc
  • php-mbstring

Check that /etc/php/ini timezone is edited.
date.timezone = "Asia/Kuala_Lumpur"

Install GIT
sudo yum install git-core

Install Composer for PHP
cd /var/www/html
curl -s | php

Install Symfony2.1
Step 1: Download from and extract

tar xvzf Symfony_Standard_Vendors_2.1.6.tgz

Read the text file Symfony/

cp composer.phar Symfony

Step 2: Basic configuration

Step 3: Create your first Symfony2 project

cd /var/www/html/Symfony
php composer.phar create-project symfony/framework-standard-edition /var/www/html/mysymfony 2.1.6

  • create-project is the command to create a project with 3 arguments
  • symfony/framework-standard-edition is the framework to be installed
  • /var/www/html/mysymfony is the new directory or project name to be created and installed with base project files
  • 2.1.6 is the version
Use a web browser to check installed project at


If there is an error, please fix before continuing. I received 2 errors to fix the directory permission for app/cache and app/logs

chown -Rf apache.apache app/logs app/cache

Note: I found following discussion useful


Unknown said...

in the las version of symfony2 you must use php5.4.

Unknown said...

you must use php 5.4

Tboxmy NAS said...

Yes, php 5.4 to be used.

Dibya Prabo S said...

i have problem on fedora with this warning in my config : Set "xdebug.max_nesting_level" to e.g. "250" in php.ini* to stop Xdebug's infinite recursion protection erroneously throwing a fatal error in your project.

mmm..any clue for solve this it?

Tboxmy NAS said...

Dibya, I have not encountered that problem. Did you find a solution?

Blog Archive