Installing Symfony2

Learn how to set up easily your Mac, Linux or Windows development environment for Symfony.

Installing Symfony2

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

Course Outcomes:
  • 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
Course Details:

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

Access Timeframe

Full Lifetime Access
Certificate Info:

Type of Certification

Certificate of Completion

Format of Certification

Digital

Professional Association/Affiliation

Udemy is not an accredited institution, but we offer skills-based courses taught by experts in their field.

Method of Obtaining Certification

When all lectures have been completed, a gold or green trophy will appear on the course dashboard, signifying that the certificate of completion is ready for download. Click on the trophy to view the certificate.

Additional Details

Certificates of completion can be accessed at Udemy.com and the mobile site, but not through the mobile apps or Apple TV. If you've completed a course on the mobile app or Apple TV, please log into Udemy.com through a browser to access your certificate.
About Instructor:

David Morales - Computer Engineer and IT Teacher

Course Outline

Install Homebrew:

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

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

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

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

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

Run the console:

php app/console

Start the web server:

php app/console server:run

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

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

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

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

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

Run the console:

php app/console

Start the web server:

php app/console server:run

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

Create pear.ini:

pear config-create / c:xamppphppear.ini

Configure directories:

pear -c pear.ini config-set doc_dir c:xamppphppeardocs

pear -c pear.ini config-set bin_dir c:xamppphp

pear -c pear.ini config-set ext_dir c:xamppphpext

pear -c pear.ini config-set php_dir c:xamppphppear

pear -c pear.ini config-set cache_dir c:xamppphpcache

pear -c pear.ini config-set cfg_dir c:xamppphpcfg

pear -c pear.ini config-set data_dir c:xamppphpdata

pear -c pear.ini config-set download_dir c:xamppphpdownload

pear -c pear.ini config-set php_bin c:xamppphpphp.exe

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

pear -c pear.ini config-set temp_dir c:xamppphptmp

pear -c pear.ini config-set test_dir c:xamppphppeartests

pear -c pear.ini config-set www_dir c:xamppphppearwww

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:xamppphppearPHPCodeSnifferStandards:

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

Add repository to CodeSniffer routes:

phpcs --config-set installed_paths Symfony2 C:xamppphppearPHPCodeSnifferStandardsSymfony2-coding-standard

Check installation:

phpcs -i

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:xamppphpextphp_opcache.dll"
opcache.enable = 1
opcache.enable_cli = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 4000
opcache.fast_shutdown = 1

Disable spelling

Search spelling

Go to Inspections

Disable Spelling

Ignore directories

Clear the search box

Go to Directories

Ignore appcache

Ignore applogs

Configure the PHP interpreter

Go to PHP

Add a new interpreter

Choose the default route C:xamppphpphp.exe

Click on OK

Configure PHP Code Sniffer

Search sniffer

Click the configuration button

Select C:xamppphpphpcs.bat

Click on Validate

Click on OK

Go to Inspections

Enable PHP Code Sniffer validation

Update the standards list

Select Symfony2

Run the console:

php appconsole

Start the web server:

php appconsole server:run

Install assets:

php appconsole assets:install web

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

Technical Requirements

Opening your operating system command lineIntroducing and copying commands in the command lineEditing text files

DON'T HAVE TIME?

We can send you everything you need to know about this course through email.
We respect your privacy. Your information is safe and will never be shared.