N
N
nektobit2016-03-25 05:58:43
PHP
nektobit, 2016-03-25 05:58:43

How to set up PHP debugging in Visual Studio Code + Open Server + Xdebug?

Hello! Maybe someone faced php debug in VS CODE? What I did myself:
1. Switched to OServer on PHP 5.6
2. Uncommented the lines according to the documentation in the php.ini file (just in case, I will give everything related to xdebug)

[Xdebug]
zend_extension="%sprogdir%/modules/php/%phpdriver%/ext/php_xdebug.dll"
;xdebug.default_enable = 1
xdebug.auto_trace = 0
xdebug.collect_includes = 1
;xdebug.collect_params = 4
;xdebug.collect_return = 1
;xdebug.collect_assignments = 1
;xdebug.collect_vars = 1
xdebug.dump.REQUEST = *
xdebug.dump.SESSION = *
xdebug.dump.SERVER = REMOTE_ADDR,REQUEST_METHOD
;xdebug.dump.COOKIE =
;xdebug.dump.FILES =
;xdebug.dump.GET =
;xdebug.dump.POST =
xdebug.dump_globals = 1
xdebug.dump_once = 1
xdebug.dump_undefined = 1
xdebug.extended_info = 1
;xdebug.file_link_format = ""
;xdebug.idekey = ""
;xdebug.manual_url = "http://www.php.net"
xdebug.max_nesting_level = 256
xdebug.overload_var_dump = 1
;xdebug.profiler_append = 1
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir="%sprogdir%/userdata/temp/xdebug/"
xdebug.profiler_output_name = "cachegrind.out.%H%R"
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
;xdebug.remote_handler = "dbgp"
;xdebug.remote_host = "localhost"
;xdebug.remote_log = "none"
;xdebug.remote_mode = "req"
xdebug.remote_port = 9000
;xdebug.scream = 1
;xdebug.show_exception_trace = 0
;xdebug.show_local_vars = 1
;xdebug.show_mem_delta = 1
;xdebug.trace_format = 1
;xdebug.trace_options = 1
xdebug.trace_output_dir = "%sprogdir%/userdata/temp/xdebug/"
;xdebug.trace_output_name = "trace.%H%R"
xdebug.var_display_max_children = 256
;xdebug.var_display_max_data = 1024
xdebug.var_display_max_depth = 16
;xdebug.remote_cookie_expire_time = 3600

3. I made sure that the path to the Xdebug DLL is correct, the server rebooted
4. Installed the extension for VS CODE "ext install php debug", reloaded the editor
5. Started the debug, put a breakpoint and ... Nothing. In the debug panel on the left, I had to observe the variables of the current script. But they are not there. The console is silent. Tried several times to start and restart the debug, all to no avail.
I would be glad for any advice, except "change to linux and install a normal IDE"
However, if you tell me how to set up another debugger in the same bundle, I will be very grateful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Arutyunov, 2016-03-25
@nektobit

Add the IDE to your Openserver bookmarks and run it from there, screen: prntscr.com/ajqa0j . This solves 90% of problems with Openserver.
In general, everything is almost the same as with phpStorm. I took the settings for php.ini from here:
yiiframework.ru/forum/viewtopic.php?t=14281

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question