how to debug in phpstorm 7.1 with built in webserver using symphony command line tool

I was able to set up a php web app debugger in php storm by simply tying it to my localhost at a specific port and everything works fine. However for that to work I need to first run this command on the shell:

    php app/console server:run --env=dev

this works just fine if i set up breakpoints for browsing the site itself or testing api calls from a browser based rest client like postman

however i'm trying to actually set breakpoints for my mobile app (the mobile app sends http calls to the backend app which is a php symphony app). Using the web app configuration doesn't work for this one.

using this tutorial I was able to incorporate the above command line into phpstorm, so now  I can actually run the code using phpstorm command line tools.

my question is: how can i actually tie the debugger to the command line within php storm? right now when I create a built-in web server in php storm it defaults to using the default php interpreter (ie If I run the code using the built in web server.. I see this in php storm's console:

   /usr/local/Cellar/php54/5.4.28/bin/php -S localhost:8000 -t /project/root/directory

what I want instead is something like this:

    php app/console server:run --env=dev -S localhost:8000 -t /project/root/directory

any idea how to do that?

1 comment
Comment actions Permalink

Hi there,

1) Configure xdebug to attempt to debug every single script (xdebug.remote_autostart = 1)

2) Use "Phone handle" icon in IDE to start listening for debug connections (e.g. as described in

3) Launch your php code from anywhere -- xdebug will attempt to debug every incoming request



Please sign in to leave a comment.