The debugger is not attached - Xdebug - Atom (php)

Viewed 1310

I'm attempting to install xdebug on to my atom in order to debug my magento 2 code on a wamp server. I think i have installed xdebug successfully according to my phpinfo() file however when I come to attach a debugger in atom, xdebug doesn't appear.

My php.ini settings are:

 ; XDEBUG Extension
 [xdebug]
 zend_extension ="c:/wamp64/bin/php/php7.1.16/zend_ext/php_xdebug-2.6.0-7.1- 
 vc14-x86_64.dll"
 xdebug.remote_host=127.0.0.1
 xdebug.remote_enable = 1
 xdebug.remote_connect_back=1
 xdebug.remote_port = 9000
 xdebug.remote_handler=dbgp
 xdebug.remote_mode=req
 xdebug.remote_autostart=true
 ;xdebug.profiler_enable = off
 ;xdebug.profiler_enable_trigger = Off
 ;xdebug.profiler_output_name = cachegrind.out.%t.%p
 ;xdebug.profiler_output_dir ="c:/wamp64/tmp"
 ;xdebug.show_local_vars=0

I haven't managed to find a complete tutorial online that works. I was following the Atom Tutorial, however I could not get it to work. I think the error may be with the IDE key as i'm not sure what to do with it. I've followed almost every youtube video but it still seems i'm doing something wrong. If someone could post a working tutorial I would very much appreciate it. Thanks in advance :)

Screenshot of the problem

PHP Version 7.1.16 Xdebug Version 2.6.1

1 Answers

I've seen in the comment section of the question, that you have moved to Visual Studio Code, But I'll write down this answer anyway as someone else may find it helpful.

I've also came across this issue: "Debugger not attached".

When you install php-debug it require one more package: atom-debug-ui - which is not the issue.

Once php-debug is installed it also recommends to install couple more packages: ide-php and atom-ide-ui. The latter package can be problematic as it also contains it's own debugger UI.

Therefore when you install all four packages, there are two set of debugger UIs running on your Atom IDE.

To overcome this, what you should do is disabling atom-ide-ui's debugger. You can also go ahead and uninstall atom-ide-ui as it's not required for php-debug to run. If ide-php package depends on atom-ide-ui, you can uninstall ide-php as well.

I understand the question is about a setup which runs on WAMP. I've written this article on how to set it up on Ubuntu based Linux. In that article I've provided all the details you want. I don't think it would be too hard to translate the information to Windows based setup.

Related