5

During the development on a Symfony 3.3 project I use the Symfony's internal server as seen there But I cannot figure out how to use the xdebug in order to debug it. I mean I have installed and configured xdebug via:

apt-get install php-xdebug

And I export:

export XDEBUG_CONFIG="idekey=phpstorm" 

But when I put a breakpoint to my IDE and I enable the xdebug via that plugin I still get no response.

Also I have put the following settings on /etc/php/7.0/mods-available/xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9021
xdebug.remote_mode=req

And I have configured both PhpStorm to listen over port 9021. But I still get the problem that I cannot make PhpStorm to listen over a breakpoint.

Do you fellows have any sort of idea how I can fix that over my ubuntu-16.04 machine?

Furthermore I have looked on these questions without any success:

EDIT 1

I also tried to export the following:

export XDEBUG_CONFIG="idekey=PHPSTORM"

An configuring the Firefox plugin but still get the very same behaviour. Also keep in mind that I made the PhpStorm to listen over xdebug by pressing the phpstop xdebug button button.

EDIT 2

I also put the following configuration over my PhpStorm:

Php configuration

Still does not work.

LazyOne
  • 158,824
  • 45
  • 388
  • 391
Dimitrios Desyllas
  • 9,082
  • 15
  • 74
  • 164

1 Answers1

2

In the end the following steps are needed:

  1. Put the following content into: /etc/php/7.0/mods-available/xdebug.ini

    zend_extension=xdebug.so
    xdebug.remote_enable=On
    xdebug.remote_handler=dbgp
    xdebug.remote_host=localhost
    xdebug.remote_port=9021
    xdebug.remote_mode=req
    
  2. Export:

    export XDEBUG_CONFIG="idekey=PHPSTORM"
    
  3. Then configure PhpStorm as the image shows.

  4. Set as IDE key PHPSTORM into the Firefox plugin

  5. Enable xdebug on Firefox via pressing the Firefox enable xdebug button button. Alternatively you can append the url with ?XDEBUG_START part

  6. Then press the button disabled xdebug button in PhpStorm. In case you see the PhpStorm enable xdebug](https://i.stack.imgur.com/whuPx.png) button press that until it becomes ![button disabled xdebug then press it back again.

NOTE:

In case you change xdebug settings TERMINATE the xdebug session by pressing PhpStorm enable xdebug button and pressing back again.

Furthermore in case you run composer via terminal disable PhpStorm to listen xdebug by pressing PhpStorm enable xdebug button.

Dimitrios Desyllas
  • 9,082
  • 15
  • 74
  • 164
  • *"Then configure PhpStorm as the image shows"* You are NOT using DBGp Proxy -- please do not confuse people with useless stuff (just because it has possibly-related-at-first-glance fields). 1) Are you actually using DBGp Proxy? 2) Have you actually installed that software (which is a completely separate thing)? 3) Do you use `DBGp Proxy | Register IDE` in order to actually use it? I'm sure it will be "No" for all 3 of them .. as this is simply not needed for local development. – LazyOne Oct 26 '17 at 09:07
  • *"Enable xdebug on Firefox via pressing the Firefox enable xdebug button button. Alternatively you can append the url with ?XDEBUG_START part"* If you are using `xdebug.remote_autostart=On` then Firefox addon is simply not needed at all .. as with that option xdebug will try to debug **every single script** (so you will see approx 1 sec delay when each script executes while it tries to connect to debug client). Better turn it off and initiate sessions via that addon (or query string parameter). – LazyOne Oct 26 '17 at 09:11
  • LazyOne pleasem look on `xdebug.ini` over `xdebug.remote_handler=dbgp` – Dimitrios Desyllas Oct 26 '17 at 09:15
  • And?.. It's a standard thing -- default handler. It has no relation to DBGp Proxy if that's what you are referring to. Have a read on what DBGP Proxy is used for: https://confluence.jetbrains.com/display/PhpStorm/Multi-user+debugging+in+PhpStorm+with+Xdebug+and+DBGp+proxy – LazyOne Oct 26 '17 at 09:25