0

I'm using XAMPP and PHP-Debug package for Atom IDE and download xdebug dll file.

this is my php.ini xdebug :

[xdebug]
zend_extension="C:\xampp\php\ext\php_xdebug-2.7.2-7.3-vc15-x86_64.dll"
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_connect_back=0    # Not safe for production servers
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_mode=req
xdebug.remote_autostart=1
xdebug.remote_log="C:\Users\mehra\Documents\xdebug.log"

and using XAMPP and ATOM IDE for run a simple script but I get this error :

[12120] Log opened at 2019-08-08 13:36:30
[12120] I: Connecting to configured address/port: localhost:9000.
[12120] E: Time-out connecting to client (Waited: 200 ms). :-(
[12120] Log closed at 2019-08-08 13:36:30
[12120]

I see someone suggest to changexdebug.remote_autostart=1 to xdebug.remote_autostart=0 and read xdebug Time-out connecting to client. :-( using phpstorm 7.1.3/vagrant/virtualbox/magento but still doesn't work

PHP-debugger setting :

enter image description here

LazyOne
  • 158,824
  • 45
  • 388
  • 391
mehran arbabian
  • 138
  • 1
  • 10
  • 1) Check firewall rules -- ensure that Atom (or how that debugger package inside the Atom works) is allowed to accept connections on TCP 9000 port. 2) Make it listening to debug connections (not using Atom myself so cannot give instructions on that) and then check with `netstat` or similar tool that it actually listens on TCP 9000 port. 3) Maybe try `127.0.0.1` instead of `localhost` (sometimes makes the difference, especially if IPv6 has priority over IPv4) – LazyOne Aug 08 '19 at 14:51
  • @LazyOne 1)i turn off firewall 2) i read a guide in atom web site about this(https://atom.io/packages/php-debug) dubegger config is so simple and there is nothing in port 9000(netstat) 3) i changed it to 127.0.0.1 and still doesn't work – mehran arbabian Aug 08 '19 at 18:15
  • 1
    *"and there is nothing in port 9000(netstat) "* For me this clearly suggests that you have missed some point from the manual (e.g. #3 from the manual)... and Atom is no yet listening for incoming debug requests from Xdebug. if it's not listening (for whatever reason).. then no wonder that Xdebug is unable to connect. – LazyOne Aug 08 '19 at 18:56
  • https://github.com/gwomacks/php-debug/issues/307 reported bug from xdebug may be xdebug has problem?! – mehran arbabian Aug 09 '19 at 06:56
  • 1
    ?? Why do you think it's Xdebug issue? I do not see anywhere in that link that would say "xdebug bug"... P.S. I hope you understand the difference between Xdebug (PHP extension) and Php Debug (debug extension for Atom). – LazyOne Aug 09 '19 at 08:09
  • Atom ide use php debug and php debug use xdebug extension php debug and xdebug are same from the atom user perspective – mehran arbabian Aug 09 '19 at 13:05
  • 1
    *"Atom ide use php debug and php debug use xdebug extension php debug and xdebug are same from the atom user perspective"* Nope. "Php Debug" is an Atom package .. that works with Xdebug. A bug or misconfiguration in Php Debug Atom package does not mean a bug or misconfiguration in Xdebug PHP extension. – LazyOne Aug 09 '19 at 13:40

1 Answers1

1

after so many try i solved my problem with some change:

1-File->Settings->Packages->ide-php

PHP Path :C:\xampp\php\php.exe

2-php.ini:

zend_extension="C:\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=1
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=0    # Not safe for production servers
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.remote_mode=req
xdebug.remote_autostart=1
xdebug.remote_log="C:\Users\mehra\Documents\xdebug.log"
xdebug.idekey =xdebug-atom

3-install xdebug helper extension for chrome or Firefox :

enter image description here

4- enter image description here

5-and change path mapping in php-debug package to [{"remotePath":"C:/xampp/htdocs","localPath":"C:/xampp/htdocs"}]

6-click on php debug icon and refresh Chrome or Firefox(with alt+F9 in your code) : enter image description here

https://www.imprich-create.site/archives/366

mehran arbabian
  • 138
  • 1
  • 10
  • 1
    Small note: If you have `xdebug.remote_autostart=1` then you do not need Xdebug browser helper -- with that option Xdebug will try to debug every single request regardless of the presence or absence of Xdebug COOKIE that such browser extensions adds. – LazyOne Aug 14 '19 at 17:14