Ceci est une ancienne révision du document !


Créer un nouveau projet Symfony

Comment créer un nouveau projet Symfony et paramétrer l'environnement du projet.

Résumé

Installer l'environnement Symfony dans le répértoire du projet

Il faut que GIT soit configuré

Se rendre dans le dossier racine qui contiendra le dossier de votre projet et taper : symfony new test-api-project

Pour un projet simple, comme une API utilser juste symfony new test-api-project

D:\webprojects>symfony new test-api-project
* Creating a new Symfony project with Composer
  (running C:\ProgramData\ComposerSetup\bin\composer.bat create-project symfony/website-skeleton test-api-project)
 
* Setting up the project under Git version control
  (running git init test-api-project)
 
 [OK] Your project is now ready in D:\webprojects\test-api-project

Tester

Lancer le serveur

On se rends dans le dossier de l'appli : cd test-api-project

Et on lance le serveur avec : symfony server:start

D:\webprojects>cd test-api-project
 
D:\webprojects\test-api-project>symfony server:start
 
 [WARNING] run "symfony.exe server:ca:install" first if you want to run the web server with TLS support, or use
 "--no-tls" to avoid this warning
 
 
Sep 30 20:08:02 |DEBUG| PHP    Using PHP version 7.3.6 (from default version in $PATH) 
Sep 30 20:08:02 |INFO | PHP    listening path="C:\\Program Files\\php-7.3.6\\php-cgi.exe" php="7.3.6" port=58722
Sep 30 20:08:02 |DEBUG| PHP    started 
 
 [OK] Web server listening on http://127.0.0.1:8000 (PHP CGI 7.3.6)
 
 
WARNING unable to find the application log
Sep 30 20:08:49 |WARN | SERVER GET  (404) / ip="127.0.0.1"
Sep 30 20:08:50 |INFO | SERVER GET  (200) /_wdt/e71290 
Sep 30 20:08:51 |WARN | SERVER GET  (404) /robots.txt 
Sep 30 20:08:51 |WARN | SERVER GET  (404) /favicon.ico 
Sep 30 20:08:52 |WARN | SERVER GET  (404) /robots.txt 
Sep 30 20:10:27 |WARN | SERVER GET  (404) / 
Sep 30 20:10:28 |INFO | SERVER GET  (200) /_wdt/07ed06 

Test avec le navigateur

Comme indiqué ci-dessus on ouvre la page : http://127.0.0.1:8000

Pour info a ce niveau là le répertoire de l'application pèse 51Mo avec l'option –full ou 9.49Mo sans l'option –full

Vous pourriez laisser un commentaire si vous étiez connecté.