wiki/PracticeSymfony.md

64 lines
1.5 KiB
Markdown
Raw Normal View History

2016-10-22 11:53:30 +02:00
# Practice Symfony
<http://symfony.com/>
## Prérequis
### Apache
Symfony contient des fichiers `.htaccess` avec des directives DirectoryIndex, Options -MultiViews, Rewrite*, Deny.
La configuration Apache du VirtualHost doit donc contenir au minimum :
~~~{.apache}
AllowOverride Limit FileInfo Indexes Options=All,MultiViews
~~~
### PHP
<http://symfony.com/doc/current/reference/requirements.html>
Le paquet **php5-json** doit être installé.
Il faut indiquer le paramètre `date.timezone = "Europe/Paris"` dans les fichiers de configuration PHP :
- `/etc/php5/apache2/php.ini`
- `/etc/php5/cli/php.ini`
2017-09-06 15:46:14 +02:00
## Installation
2016-10-22 11:53:30 +02:00
~~~
2017-09-06 15:46:14 +02:00
$ echo '{"require": {{"symfony/framework-standard-edition": "~3.3"}}' > composer.json
$ composer update
Loading composer repositories with package information
[...]
$ cd vendor/symfony/framework-standard-edition
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing doctrine/lexer (v1.0.1)
Loading from cache
[...]
~~~
Pour tester la configuration, des tests peuvent être lancés ainsi :
~~~
$ cd vendor/symfony/framework-standard-edition
2016-10-22 11:53:30 +02:00
$ php bin/symfony_requirements
2017-09-06 15:46:54 +02:00
2017-09-06 15:46:14 +02:00
Symfony Requirements Checker
> PHP is using the following php.ini file:
/etc/php/7.0/cli/php.ini
> Checking Symfony requirements:
................................W........
2017-09-06 15:46:54 +02:00
2017-09-06 15:46:14 +02:00
[OK]
Your system is ready to run Symfony projects
[...]
~~~