Aller au contenu principal

Install new Symfony2 projet with Composer in Windows

décembre 27, 2012

A) Adjust Apache/MySQL/Php settings
To correctly installing and running Symfony2, we need some settings and php extensions in « php.ini » file.

Mandatory « php.ini settings :
– Extensions (JSON, ctype, openssl)
– Settings (date.timezone) ex date.timezone = Europe/Paris

Also some « php.ini » recommended settings to verify :
– Extentions (
libxml, PHP-XML, PHP tokenizer,
mbstring,
iconv,
Intl needs to be installed with ICU 4+,
APC 3.0.17+ :
download from
and depends on « Zend Extension Build » from phpinfo() output we can choose the right version of APC to install e.g TS or NTS.
)
– Settings (
short_open_tag = Off
magic_quotes_gpc = Off
register_globals = Off
session.auto_start = Off
)

Fix the PATH variable before launching xampp controller with these commands (or make a xampp.bat file)

PATH %CD:~0,2%\dev\php\xampp\php;%PATH%
START /d "%CD:~0,2%\dev\php\xampp\" xampp-control.exe

B) Install Symfony 2

1- get Composer.phar executable file in current workspace :
curl -s https://getcomposer.org/installer | php

2- create a new Symfony2 project :
php composer.phar create-project symfony/framework-standard-edition /path/to/myprojectroot 2.1.6

3- add all required bundles to Composer.json :
for example adding

...
"require": {
        ...
        "doctrine/doctrine-fixtures-bundle": "dev-master",
        "doctrine/data-fixtures": "dev-master"
    },
...

4- update vendor directory
Copie Composer.phar from workspace directory to the new project root directory
copy ..\Composer.phar .

and update vendors
php composer.phar install

C) Check system settings
CLI php chek : php app/check.php
Web php check : web/config.php (from navigator)

From → Uncategorized

2 commentaires
  1. effexts permalink

    Windows, and you configure « LAMP » ? lol

    • Thanks for your comment… I wanded to say « LAMP » equivalent environment for Windows !

Répondre à mazicr Annuler la réponse.