• | 7324 points

    Hi @leokhoa I have difficulties to use XDebug with the last php 7.0.8
    I have added to PHP extensions directory, the last version of XDebugfor PHP 7 NTS 32bits.
    And in php.ini :

    zend_extension = php_xdebug.dll
    xdebug.default_enable = 1
    xdebug.remote_autostart = 1

    In phpinfo() I could see that XDEBUG is correctly loaded and listen on port 9000.

    But I don't success to debuggPHP code in Microsoft Visual Studio Code and its PHP Debug extension:

    With php 5.6.16 it was working nicely.
    Not sure what I am missing here.

  • | 7324 points

    It is not related to laragon.
    But more with my code which generates Exception under PHP 7, so breakpoints are not used(which is strange, breakpoint is before exception)
    Breakpoints are working as expected with other php code.

  • administrators
    | 126706 points

    Cool. Are you using Microsoft Visual Studio Code instead of Sublime Text ?
    I had tried VS Code and was impressed, but I am not sure the trend.

  • | 7324 points

    Yes I love this software, after using Sublime text, and then Atom, now I'm using exclusively Visual Studo Code.
    It's really fast, and almost no need to install any extra plugin to get everything I need for PHP/JS/SASS/CSS.
    Compared to Atom which is pretty slow with lots of modules installed.
    And Debugging is really pleasant with VSC, I wasn't convinced at all with Xdebug plugin for Sublime & Atom: slow and interface not easy to use.
    Here it's working with almost no configuration, and works as a real IDE, breakpoints, call stack, watch...And it's FAST !

    Usually I'm against using proprietary softwares, except for Microsoft itself, but here it's hard to use anything else.

  • administrators
    | 126706 points

    Many thanks for your information. Congrats VS Code. I will try it :)

  • | 7324 points

    Regarding my debugging issue with a particular PHP project(other work as expected) and PHP 7.0.
    I still don't know why XDebug doesn't stop on my breakpoints set. I'm not sure anymore it is related to PHP exception. because I don't have any now.
    I have the same result on Atom and on Visual studio Code.
    So I suppose the bug comes from the last version of XDebug 2.4 with PHP 7.

    I found a workaround, instead of setting breapoint with the editor UI, I insert a call to the php function xdebug_break() where I need to break. and it works as expected.

  • | 7324 points

    I just tried your last version 2.0.2 with php 7.08 thread safe with the corresponding XDebug version. And breakpoints are now working too on my buggy project :-)

  • administrators
    | 126706 points

    You are so patient, man :)
    Look like an issue of Xdebug with PHP 7.0.8 nts
    With the way you are doing, no bug can hide :+1:

  • | 2855 points

    Perhaps a stupid thing to ask, but did you use to nts version of xdebug for the nts version of php. I work with xdebug too in php 7.0.9 (and all versions before) and it is working as expected.
    (using phpstorm btw)

  • | 7324 points

    Yes I did use the corresponding version of xdebug. But my problem wasn't that xdebug wasn't working at all. It was working but not for all of my projects.
    The issue was that xdebug wasn't stopping at my declared breakpoints but was seeing php notices and warnings.
    Switching to thread version of php and xdebug solved my issue.
    I will test it with php 7.0.9 to see of it solves my debbuging issue with this particular project.

  • | 7324 points

    I just tried with PHP 7.0.9NTS & Xdebug NTS PHP 7.0 VC14 with my buggy project and it is working now :-)
    To be sure, I rechecked my project with PHP 7.0.8NTS and it is still not working.

    Good news I will be able to use only PHP NTS

  • | 2855 points

    Just to be sure, this mis my (part of) php.ini:

    zend_extension = "C:/Development/Laragon/bin/php/php-7.0.8-64-nts/ext/php_xdebug-2.4.0-7.0-vc14-nts-x86_64.dll"
    xdebug.idekey = "Intellij"
    xdebug.profiler_append = 0
    xdebug.profiler_enable = 1
    xdebug.profiler_enable_trigger = 1
    xdebug.profiler_output_dir = "C:/Development/Laragon/tmp/xdebug"
    xdebug.profiler_output_name = "cachegrind.out.%u-%H_%R"
    xdebug.remote_enable = 1
    xdebug.remote_handler = "dbgp"
    xdebug.remote_host = localhost
    xdebug.remote_port = 9000
    xdebug.var_display_max_depth = 20
    xdebug.var_display_max_data = 2048
    xdebug.trace_output_dir = "C:/Development/Laragon/tmp/xdebug"

  • | 121 points

    How can we switch to PHP non thread safe? Because I dont have xdebug.dll in my ext folder when I installed version 2.0.2.

  • administrators
    | 126706 points

  • | 4834 points

    Got stuck on this myself (specifically running my laravel tests with xdebug from cmd line in vscode).

    I was following this tutorial: https://tighten.co/blog/configure-vscode-to-debug-phpunit-tests-with-xdebug which is for mac/linux and as I'm using Laragon/Windows I ended up here.

    I did add PHP NTS, but not sure that it was needed. I think it's most likely that the solution was by adding the following options as a minimum in php.ini


    This post prompted me to add xdebug.remote_host=localhost the https://xdebug.org/archives/xdebug-general/1865.html which made the difference.

    I also set the env var by running setx XDEBUG_CONFIG "idekey=VSCODE", again not sure if that made the difference or not but was one step I took.

    Hope this helps someone!

  • | 213 points

    @leokhoa said in [SOLVED] XDEBUG & PHP 7.0.8:

    @filipveschool :

    1. You need to download the PHP NTS from http://windows.php.net/download
      Refer: https://forum.laragon.org/topic/166/tutorial-how-to-add-another-php-version
    2. You can download Xdebug from https://xdebug.org/download.php

    Years later... I have been using PHP 7+, but a project came into play that is using 5.6 still.. I don't want to bother with the upgrade at the moment, but needed to debug.

    Anyways I had 5.6 running and found the proper version of xdebug and until I read this and decided to try the NTS I was having 0 luck getting it to trigger. As soon as I added the NTS version and threw my xdebug file + php.ini code it triggered right away.

    I just wanted to leave this here in case anyone is coming into xdebug issues in general.

    (I also noticed after its because I didn't get the TS (Thread Safe) version of xdebug, this was probably why when I swapped PHP versions it magically worked)

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.