MoobyFR's blog

Some IT infos
Home

Aller au menu | Aller à la recherche

Symfony 3.4, phpStorm configuration and debug

, 12:34 - Lien permanent

Having the best tools for working on a project, but how to make them work together ?

  • phpStorm as IDE
  • Symfony as framework

PHP requirement

$ sudo apt install php-xml php-debug

Installer basic symfony project:

$ curl -LsS https://symfony.com/installer -o ~/symfony && chmod u+x  ~/symfony
$ ~/symfony new testproj 3.4
$ cd testproj; git init ; git add . ; git commit -a -m import

Launch phpStorm

Select "Create new project from existing files" -> "Web server is locally, sources are under ..."

Verify that you have the following plugins installed and activated:

  • Symfony Plugin
  • PHP Annotation
  • PHP Toolbox
  • PHP composer.json support

How to verify that you can debug correctly

In a console (for example on the console tab at bottom of phpStorm), start the server:

$ bin/console server:run

In PhpStorm

  • "Run" -> "web server debug validation"
  • Check "Local web server"
  • Path to create validation script must be: ~/PhpstormProjects/testproj/web
  • url to validation script http://127.0.0.1:8000/