1

I have installed xdebug on my MacBook Pro with PHP 5.6.29 and using sublimeXdebug as client (both server and client are on same machine).

It works perfectly fine when I connected to internet and xdebug.remote_host=192.168.0.35. It is not working when I specify the configuration as xdebug.remote_host=127.0.0.1 or xdebug.remote_host=localhost.

I won't be on internet all the time. And the internet address changes every time I connect to access point. I don't want to go the php.ini file to edit the configuration each and every time I connect to internet.

How do I fix this?

My Xdebug configuration in /etc/php.ini file is

zend_extension= /usr/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_log="/var/log/xdebug/xdebug.log"
LazyOne
  • 158,824
  • 45
  • 388
  • 391
lucifer
  • 110
  • 8
  • 1) Do you have local web server (Apache/nginx)? 2) If you do -- how they run PHP -- php-fpm perhaps? – LazyOne Mar 02 '17 at 21:16
  • I am using Apache webserver. I didn't get your second question. – lucifer Mar 03 '17 at 12:46
  • Well .. OK. 1) Please run this command and show the results: `sudo lsof -nP -iTCP -sTCP:LISTEN` -- I need to see who listens on TCP 9000 port 2) Please provide xdebug log (`xdebug.remote_log`) for such successful and not debug sessions. – LazyOne Mar 03 '17 at 12:57
  • 1
    have you tried xdebug.remote_connect_back = 1 and remove the xdebug.remote_host=127.0.0.1 setting? – Milan Markovic Mar 03 '17 at 13:12

1 Answers1

1

Use this in your php.ini:

xdebug.max_nesting_level = 10000

xdebug.remote_autostart = 0

xdebug.remote_enable = 1

xdebug.remote_port = 9000

You can try having xdebug.remote_autostart = 1 instead of 0 above to just try things out and see if it is working.

Zatara7
  • 241
  • 2
  • 11
  • I don't know exactly why it isn't working but from looking at the path of your xdebug, you are not using macports (or something like that.) I urge you to look up macports and install all of your stack from there (apache, php, xdebug, mysql, etc...) – Zatara7 Mar 02 '17 at 17:45
  • I think it can be solved with some configuration changes, rather than installing the whole stack again. – lucifer Mar 02 '17 at 17:51