The Easiest Way To Debug A Symfony Application in PhpStorm

Mert Sevinc
3 min readSep 25, 2018

Do you know that many PHP developers do not know how to use IDEs to debug their applications ? It’s actually common practice for majority of them to search for errors by outputting variables to a console. This may sound kind of ridiculous to you if you come from .NET or Java like I do since we are used to work with powerful IDEs. Debugging without breakpoints and watchers sounds terrible and primitive :-)

Obviously, there are good reasons behind why PHP developers don’t use IDE debuggers. I am not going to list the reasons here since this is not our topic. However, I can assure you that after working with many junior & senior PHP developers, I can conclude that the number one reason they don’t use a debugger is simply they don’t know how to set it up :-)

Today, I am going to show a very simple way to use Xdebug, PHPStorm and Symfony in order to debug an application. PHPStorm is the best IDE I have used so far and it comes with amazing functionalities. Anyways here we go:

Run/Debug Configuration

In order to run/debug a Symfony application within PHPStorm, we need to create a new configuration under “Run/Debug Configurations”.

The new configuration will be based as a “PHP script”. The file for this script will point to “bin/console”, which is…

--

--