Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Atom + Xdebug setup

Tags:

I'm trying to setup Xdebug because I'm tired of using echoes and var_dumps. I'm using Atom as my IDE with the php-debug plugin. I'm using the laravel Homestead vm as a server. forwarded port 9000 to 9999 Atom has the plugin installed with the following settings: enter image description here

I set a breakpoint in Atom, I browse to my page but the breakpoint doesn't trigger. I have a hunch that it has something to do with the IDE key but I don't know how to proceed. enter image description here

Does anyone know the IDE key for atom? Or is there something else I'm missing?

edit: I've added the following to xdebug.ini:

xdebug.auto_trace = 0 xdebug.collect_includes = 1 xdebug.collect_params = 1 xdebug.collect_return = 0 xdebug.collect_vars = "Off" xdebug.default_enable = "On" xdebug.dump.COOKIE = "" xdebug.dump.FILES = "" xdebug.dump.GET = "" xdebug.dump.POST = "" xdebug.dump.REQUEST = "" xdebug.dump.SERVER = "" xdebug.dump.SESSION = "" xdebug.dump_globals = 1 xdebug.dump_once = 1 xdebug.dump_undefined = 0 xdebug.extended_info = 1 xdebug.file_link_format = "" xdebug.idekey = "VVVDEBUG" xdebug.manual_url = "http://www.php.net" xdebug.max_nesting_level = 100 xdebug.overload_var_dump = 1 xdebug.profiler_append = 0 xdebug.profiler_enable = 0 xdebug.profiler_enable_trigger = 1 xdebug.profiler_output_dir = "/tmp" xdebug.profiler_output_name = "cachegrind.out.%t-%s" xdebug.remote_autostart = 1 xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp" xdebug.remote_host = "192.168.50.1" xdebug.remote_log = /srv/log/xdebug-remote.log xdebug.remote_mode = "req" xdebug.remote_port = 9000 xdebug.show_exception_trace = 0 xdebug.show_local_vars = 0 xdebug.show_mem_delta = 0 xdebug.trace_format = 0 xdebug.trace_options = 0 xdebug.trace_output_dir = "/tmp" xdebug.trace_output_name = "trace.%c" xdebug.var_display_max_children = -1 xdebug.var_display_max_data = -1 xdebug.var_display_max_depth = -1 
like image 477
SnelleJelle Avatar asked Mar 08 '16 10:03

SnelleJelle


People also ask

Does atom have a built in debugger?

atom-debugger package This is a debugger for atom.io, which now only support gdb . This package is still in very early stage.

How do you create a breakpoint in an atom?

Notes on use. Use: cmd-alt-b cmd-alt-b (double tap) to toggle a breakpoint on the current line. cmd-alt-b s to set a breakpoint on the current line.


2 Answers

Like @sparkos72 says, the atom ide key xdebug.atom works for me on Ubuntu 16.04 and Debian 7 :-). I try to extend their answer.

I used php-debug atom extension with this config in the xdebug.ini (path: /etc/php5/apache2/conf.d/xdebug.ini).

xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=172.17.0.1 xdebug.remote_port=9000 xdebug.idekey=xdebug.atom xdebug.remote_autostart=true 

I have a docker container with debian 7 + apache + php 5, that's the reason because I use ip 172.17.0.1 instead of 127.0.0.1. My "real" machine is an Ubuntu.

Hope it helps.

like image 117
mrroot5 Avatar answered Oct 10 '22 19:10

mrroot5


IDE key is xdebug.atom for me (mac/apache). In the Atom php-debug config, set the server port to 9000

like image 25
sparkos72 Avatar answered Oct 10 '22 19:10

sparkos72