[SOLVED] XDEBUG & PHP 7.0.8


  • | 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 :

    [XDebug]
    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:
    https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug

    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
    | 47916 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
    | 47916 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
    | 47916 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:


  • | 2812 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


  • | 2812 points

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

    [XDebug]
    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"
    //xdebug.trace_enable_trigger=1
    //xdebug.trace_output_name=xdebug.trace.%t.%R
    //xdebug.show_mem_delta=1
    //xdebug.collect_params=4
    //xdebug.collect_return=1
    xdebug.trace_format=1


  • | 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
    | 47916 points


Log in to reply
 

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