Installing Symfony2

Learn how to set up easily your Mac, Linux or Windows development environment for Symfony.
4.4 (84 ratings) Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
4,406 students enrolled
Free
Start Learning Now
  • Lectures 26
  • Length 33 mins
  • Skill Level Beginner Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 2/2014 English

Course Description

2016 Update: re-recorded for Symfony 2.8 LTS and ready for Symfony 3.0

With this course you will learn how to set up easily your Mac, Linux or Windows development environment for Symfony.

You will learn to:

- Install PHP

- Configure the Symfony coding standards

- Create a project

- Configure the PhpStorm IDE for Symfony

- Start the web server to start programming

What are the requirements?

  • Opening your operating system command line
  • Introducing and copying commands in the command line
  • Editing text files

What am I going to get from this course?

  • Install the latest version of PHP
  • Install and set up the coding standards
  • Install Symfony2 and create your first project
  • Configure the PhpStorm IDE to be ready for Symfony2
  • Start the web server to develop easily in your operating system

What is the target audience?

  • Developers that know PHP and want to learn to use the most popular framework
  • Developers that want to improve their development environment for Symfony2

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Installing Symfony2 on OS X
Introduction (OS X)
00:50
Documentation (OS X)
Article
00:24

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
01:50

Install PHP:

brew tap homebrew/dupes

brew tap homebrew/versions

brew tap homebrew/homebrew-php

brew install php56

Install debug and intl:

brew install php56-xdebug

brew install php56-intl

01:22

Install PHP Code Sniffer:

brew install php-code-sniffer

Clone repository in /usr/local/Cellar/php-code-sniffer/1.4.7/CodeSniffer/Standards:

git clone git://github.com/escapestudios/Symfony2-coding-standard.git /usr/local/etc/php-code-sniffer/Standards/Symfony2

Add repository to CodeSniffer routes:

phpcs --config-set installed_paths /usr/local/etc/php-code-sniffer/Standards/Symfony2-coding-standard/

Check installation:

phpcs -i

02:34

sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony
symfony new symfony2test 2.7

Add time zone in /usr/local/etc/php/5.6/php.ini:

date.timezone = Europe/Madrid (replace it with your time zone)

Install Zend OpCache:

brew install php56-opcache

Configure OpCache in /usr/local/etc/php/5.6/conf.d/ext-opcache.ini:

opcache.enable_cli = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 4000
opcache.fast_shutdown = 1

02:01

Disable spelling

Search spelling

Go to Inspections

Disable Spelling

Ignore directories

Clear the search box

Go to Directories

Ignore app/cache

Ignore app/logs

Configure the PHP interpreter

Go to PHP

Add a new interpreter

Specify other route

Write the route —> /usr/local/bin/php

Click on OK

Configure PHP Code Sniffer

Search sniffer

Click the configuration button

Write the route —> /usr/local/bin/phpcs

Click on Validate

Apply changes

Go to Inspections

Enable PHP Code Sniffer validation

Update the standards list

Select Symfony2

01:05

Run the console:

php app/console

Start the web server:

php app/console server:run

00:28

Although Composer is not required to use Symfony, if you ever want to include a third party bundle you will need it.

Section 2: Installing Symfony2 on Ubuntu
Introduction (Ubuntu)
00:37
Documentation (Ubuntu)
Article
00:35

sudo apt-get install php5
sudo apt-get install php5-xdebug
sudo apt-get install php5-intl

01:46

Install PHP Code Sniffer:

sudo apt-get install php-codesniffer

Install git:

sudo apt-get install git

Clone repository in /usr/share/php/PHP/CodeSniffer/Standards:

sudo git clone git://github.com/escapestudios/Symfony2-coding-standard.git /usr/share/php/PHP/CodeSniffer/Standards

Add repository to CodeSniffer routes:

sudo phpcs --config-set installed_paths /usr/share/php/PHP/CodeSniffer/Standards/Symfony2-coding-standard/

Check installation:

phpcs -i

02:33

sudo apt-get install curl sudo curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
sudo chmod a+x /usr/local/bin/symfony
symfony new symfony2test 2.7

Add time zone in /etc/php5/cli/php.ini:

date.timezone = Europe/Madrid (replace it with your time zone)

Install PDO controller:

sudo apt-get install php5-mysqlnd

02:00

Install JDK:

sudo apt-get install openjdk-8-jdk

Disable spelling

Search spelling

Go to Inspections

Disable Spelling

Ignore directories

Clear the search box

Go to Directories

Ignore app/cache

Ignore app/logs

Configure the PHP interpreter

Go to PHP

Add a new interpreter

Choose the default route /usr/bin/php

Write the name PHP

Click on OK

Configure PHP Code Sniffer

Search sniffer

Click the configuration button

Write the route —> /usr/bin/phpcs

Click on Validate

Click on OK

Go to Inspections

Enable PHP Code Sniffer validation

Update the standards list

Select Symfony2

01:01

Run the console:

php app/console

Start the web server:

php app/console server:run

01:18

Although Composer is not required to use Symfony, if you ever want to include a third party bundle you will need it.

Section 3: Installing Symfony2 on Windows
Introduction (Windows)
00:36
Documentation (Windows)
Article
Installing PHP (Windows)
00:13
03:16

Create pear.ini:

pear config-create / c:\xampp\php\pear.ini

Configure directories:

pear -c pear.ini config-set doc_dir c:\xampp\php\pear\docs

pear -c pear.ini config-set bin_dir c:\xampp\php

pear -c pear.ini config-set ext_dir c:\xampp\php\ext

pear -c pear.ini config-set php_dir c:\xampp\php\pear

pear -c pear.ini config-set cache_dir c:\xampp\php\cache

pear -c pear.ini config-set cfg_dir c:\xampp\php\cfg

pear -c pear.ini config-set data_dir c:\xampp\php\data

pear -c pear.ini config-set download_dir c:\xampp\php\download

pear -c pear.ini config-set php_bin c:\xampp\php\php.exe

pear -c pear.ini config-set php_prefix \php.exe

pear -c pear.ini config-set temp_dir c:\xampp\php\tmp

pear -c pear.ini config-set test_dir c:\xampp\php\pear\tests

pear -c pear.ini config-set www_dir c:\xampp\php\pear\www

Configure auto discover:

pear -c pear.ini config-set auto_discover 1

Clear cache:

pear -c pear.ini clear-cache

Install PHP Code Sniffer:

pear -c pear.ini install —alldeps PHP_CodeSniffer

Clone repository in C:\xampp\php\pear\PHP\CodeSniffer\Standards:

git clone git://github.com/escapestudios/Symfony2-coding-standard.git

Add repository to CodeSniffer routes:

phpcs --config-set installed_paths Symfony2 C:\xampp\php\pear\PHP\CodeSniffer\Standards\Symfony2-coding-standard

Check installation:

phpcs -i

02:53

php -r "readfile('http://symfony.com/installer');" > symfony php
symfony new symfony2test 2.7

Enable xdebug in php.ini:

Uncomment XDebug's zend_extension

Enable intl in php.ini:

Uncomment extension=php_intl.dll

Add xdebug's max nesting level:

xdebug.max_nesting_level = 250

Configure OpCache:
[Opcache]
zend_extension = "C:\xampp\php\ext\php_opcache.dll"
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 4000
opcache.fast_shutdown = 1

02:02

Disable spelling

Search spelling

Go to Inspections

Disable Spelling

Ignore directories

Clear the search box

Go to Directories

Ignore app\cache

Ignore app\logs

Configure the PHP interpreter

Go to PHP

Add a new interpreter

Choose the default route C:\xampp\php\php.exe

Click on OK

Configure PHP Code Sniffer

Search sniffer

Click the configuration button

Select C:\xampp\php\phpcs.bat

Click on Validate

Click on OK

Go to Inspections

Enable PHP Code Sniffer validation

Update the standards list

Select Symfony2

01:21

Run the console:

php app\console

Start the web server:

php app\console server:run

Install assets:

php app\console assets:install web

01:03

Although Composer is not required to use Symfony, if you ever want to include a third party bundle you will need it.

Section 4: Bonus: Learning to develop with Symfony2
Bonus lecture: Introduction to web development with Symfony2
Article

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

David Morales, Computer Engineer and IT Teacher

Since the year 2000 I have been teaching to public and private companies from Barcelona, mainly about Unix and Linux systems, and web technologies such as PHP, Javascript and Java.

In 2005 I completed my B.S. in Computer Science at the University of Barcelona.

I have worked for several startups using PHP and the Symfony framework since 2006. In 2011 I switched to Ruby on Rails as my main framework to continue building big complex web sites.

Ready to start learning?
Start Learning Now