2

I have a symfony project and I am running it with the "bin/console server:run" command. I need to debug the project on Windows! I am using the PhpStorm IDE. I have downloaded the proper XDebug dll and setup the proper(I believe) settings in the php.ini file.

zend_extension = "C:\xampp\php\ext\php_xdebug-2.4.0-5.6-vc11.dll"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.profiler_enable=1
xdebug.profiler_output_dir="C:\xampp\tmp"
xdebug.idekey=PHPSTORM

I have properly setup the php interpreter in the IDE and it detected the xdebug. I have followed this article. I have tried a lot of different PhpStorm configurations but without success. What's the proper way to debug a php project which is ran from the console with PhpStorm? Is it remote debugging and how can I setup it? Should I set some mappings or something else?

3
  • Have a look at this first: confluence.jetbrains.com/display/PhpStorm/… (pick the most appropriate article). Try "zero-config" approach. In general -- you may need to provide "host/server name" somehow (it is used to identify "PHP | Server" entry and is required by PhpStorm). considering the way how you are launching your server .. you may need to look at "remote CLI script debug" section. If anything -- collect xdebug logs. Commented Apr 16, 2016 at 21:03
  • 1
    BTW -- this one looks somehow similar/related: stackoverflow.com/a/23653272/783119 Commented Apr 16, 2016 at 21:05
  • The solution in the other topic worked! Commented Apr 16, 2016 at 21:58

1 Answer 1

1

I have only needed to install xdebug, set the following configuration to the php.ini file:

zend_extension = "C:\xampp\php\ext\php_xdebug-2.4.0-5.6-vc11.dll"
xdebug.remote_enable=1
xdebug.remote_autostart=1

And configure the php interpreter in the IDE. After this configuration the debugging works out of the box in PhpStorm! It is only needed to click the "Start listening for debugging connections" icon. It is not needed to setup any debugging servers.

Sign up to request clarification or add additional context in comments.

1 Comment

Not always xdebug.remote_autostart=1 will be a desired way of doing this. It's better to initiate actual debug from outside (cookie/get param by the help of browser extension/bookmarklet/from inside IDE) instead of attempting to debug every single request. If those 3 lines above is all what you had to do .. then the only missing thing from your initial attempt is actual debug triggering...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.