Search code examples
phpxdebugphp-7.4xdebug-3

Xdebug xdebug.mode = debug not working for me


I have installed Xdebug on a Ubuntu 20.04 system. I followed this documentation , which I found to be quite well written, and got everything installed per the specs. (I used apt rather than yum, and placed the .so file into /usr/lib/php/20190902 folder rather than the document's example.)

In that document, there is a reference to adding to the php.ini file (I added to /etc/php/7.4/apache2/php.ini and /etc/php/7.4/cli/php.ini files). Since the article doesn't specifically mention "sections" of the .ini file, I put them within the [PHP] section. (This is consistent with the remark about putting right before the Quick Reference bit.) I restarted Apache2 and the phpinfo() output now includes Xdebug, which it did not include before. All well and good.

The trouble I'm having is that although I set xdebug.mode = debug in the php.ini files, the phpinfo() output tells me that xdebug.mode is set to develop. Consequently, Step debugger shows as Disabled in my configuration. I cannot see why.

These are the lines I've added to each of those php.ini files:

zend_extension="/usr/lib/php/20190902/xdebug.so
xdebug.mode = debug
xdebug.discover_client_host = 1
xdebug.start_with_request = yes

And here are the key excerpts from the phpinfo() output:

Xdebug settings 1

Xdebug settings 2

On a whim, I tried placing all of those settings also within a new section of php.ini which I called [xdebug]. When that didn't work, I tried [Xdebug]. I restarted Apache2 after each attempt, but the symptom never changed.

What might I be missing?


Solution

  • zend_extension="/usr/lib/php/20190902/xdebug.so (that has an extra ").

    In any case, it is very likely that there is either another xdebug.mode line somewhere, or a different INI file is being used. Try to see what the output of xdebug_info() tells you — it also mentions which INI files have been read.