Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Robert LU
    @RobberPhex
    @mcarbonell I fixed that issue since robberphex.php-debug 0.1.3. Which version are you using?
    And I tested Win10 server, in macOS, I really don’t know why it's still happing.
    Mario Raúl Carbonell
    @mcarbonell
    the version I have now is 0.1.4 and still get the same error.
    Robert LU
    @RobberPhex
    anothersailor
    @anothersailor
    image.png
    Interesting discussion: been having the same problem for a few weeks now...
    anothersailor
    @anothersailor
    0.1.5 doesn't do it for me. On OSX, debugging in remote with PHP 7.2. VS Code complains about not being able to find the active remote PHP file. The path mentioned by the error message is correct, although I would have expected to see an http request, instead of a "file:///opt/nfs..." since the file is on the remote server?
    Robert LU
    @RobberPhex
    @anothersailor could you provide Xdebug remote_log?
    anothersailor
    @anothersailor
    Ok, just leave me a few hours to reconfigure the php.ini. E.
    anothersailor
    @anothersailor
    OK. Not there yet (code is running on an external server and admin has to change the php.ini), but I think I may be closing on another explanation, to do with my setup, not with your code. Will get back in this discussion if I find I am wrong! Many thanks any way for taking interest, and good luck with your other debugging! Cheers from France, E.
    Simon Shirley
    @SimonShirley
    Good evening :)
    Apologies to be a new user with a new/old problem, but looking at the plugin page, it suggests getting in touch here.
    Liron Kopinsky
    @ldkop_twitter

    Greetings - here with another one of those "xdebug can't connect" situations.

    I'm on osx running a php docker container. We just upgraded php from 7.1.7 to 7.3.3 (FROM php:7.3.3-fpm), and upgraded xdebug from 2.5.5 to 2.7.2.

    # Install Xdebug
    RUN curl -fsSL 'https://xdebug.org/files/xdebug-2.7.2.tgz' -o xdebug.tar.gz \
        && mkdir -p xdebug \
        && tar -xf xdebug.tar.gz -C xdebug --strip-components=1 \
        && rm xdebug.tar.gz \
        && ( \
        cd xdebug \
        && phpize \
        && ./configure --enable-xdebug \
        && make -j$(nproc) \
        && make install \
        ) \
        && rm -r xdebug

    Getting the following in xdebug.log:

    [20] Log opened at 2019-06-27 11:51:46
    [20] I: Connecting to configured address/port: host.docker.internal:9000.
    [20] I: Connected to client. :-)
    [20] -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" fileuri="file:///app/public/index.php" language="PHP" xdebug:language_version="7.3.3" protocol_version="1.0" appid="20" idekey="VSCODE"><engine version="2.7.2"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[https://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2019 by Derick Rethans]]></copyright></init>
    [20]
    [20] -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="https://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
    [20]
    [20] Log closed at 2019-06-27 11:52:00

    The following is the xdebug.ini:

    zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so
    xdebug.remote_enable=1
    xdebug.idekey=VSCODE
    xdebug.remote_log=/usr/local/etc/php/xdebug.log
    xdebug.remote_autostart=1
    xdebug.remote_host=host.docker.internal

    (I used to have zend_extension=xdebug.so which wasn't working, so I updated it to the full path above because that's where I find xdebug.so in the docker container, with no luck.)

    In VSCode, all I get is:

    <- launchResponse
    Response {
      seq: 0,
      type: 'response',
      request_seq: 2,
      command: 'launch',
      success: true }

    php -v on the docker container gives:

    PHP 7.3.3 (cli) (built: Mar 27 2019 01:21:44) ( NTS )
    Copyright (c) 1997-2018 The PHP Group
    Zend Engine v3.3.3, Copyright (c) 1998-2018 Zend Technologies
        with Zend OPcache v7.3.3, Copyright (c) 1999-2018, by Zend Technologies
        with Xdebug v2.7.2, Copyright (c) 2002-2019, by Derick Rethans

    Any tips about what I can do to try and debug and figure out what's wrong with my configuration?

    Liron Kopinsky
    @ldkop_twitter
    Update - GOT IT.
    Had to change the port to 9001
    Mark Carpenter Jr
    @mcarpenterjr
    Hey anyone ever do anything with a conditional breakpoint inside a public function? I have a new codebase I'm working with and trying to figure out the best way to debug the caller of a private function. I thinking of setting a conditional that looks for a specific value of one of the params, but I'm not sure how I would determine the chain that invoked the function.
    Jason T
    @jasonterando
    @mcarpenterjr - not sure if this helps you, but I think you could include a debug_backtrace call in your function, use that to set a variable to the calling function name, and then set a conditional breakpoint on that. Nothing you would want to include in a production build though...
    Mark Carpenter Jr
    @mcarpenterjr
    I found that right clicking the margin to the left of the line numbers will allow you to set a conditional.
    Thanks @jasonterando for the thought.
    lemonbrain MK
    @lemonbrain-mk

    Does anybody have experience with vscode, ubuntu 16.04 desktop and apache with php7.3. I get it up and running with "Launch currently open script" but not with "Listen for XDebug". But i also get no error message or logs, it just started but doesn't stop on a breakpoint.

    zend_extension=/usr/lib/php/20180731/xdebug.so
    xdebug.show_error_trace=1
    xdebug.remote_enable=1
    xdebug.remote_host=localhost
    xdebug.remote_handler=dbgp
    xdebug.remote_port=9001
    xdebug.remote_autostart=1
    xdebug.remote_log=/var/log/xdebug.log
    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Listen for XDebug",
                "type": "php",
                "request": "launch",
                "port": 9001,
            },
            {
                "name": "Launch currently open script",
                "type": "php",
                "request": "launch",
                "program": "${file}",
                "cwd": "${fileDirname}",
                "port": 9001
            }
        ]
    }

    Any successions?

    agriffit
    @agriffit
    Hi, I've setup PHP 7 debugging in vscode and it works great so thanks.
    I'm having a problem with PHP 5.4 though. Phpinfo on 5.4 verifies xdebug, and vscode starts listening to the php5.4 app, but break points aren't being hit.
    Is this a common issue? Anything I can do to troubleshoot?
    LiorMesser
    @LiorMesser
    image.png
    Hi, something strange happened today and I just can't find the solution or even the cause. All of a sudden, the variables in the "variables" panel do not get updated:
    Regardless of moving from script to script, they are never updated
    image.png
    Additionally, I can't add/delete/modify watch expressions, this never changes:

    I tried uninstalling the then reinstalling the extension, nothig changed. Breakpoints work ok. If I hover on any variable in the editor, I can see it's content. However, on the Watch and on the Variables panels, I can't

    Any clues?

    LiorMesser
    @LiorMesser

    Hi there. I don't know exactly why but it is working again. I rebooted my machine, restarted the WAMP server, restarted VS Code and it works now. I had done all these steps previously with no success...

    It looks like there was some kind of garbage somewhere in the settings, which eventually was repaired automatically. Anyway, working now!

    Henry
    @Henry69_gitlab

    I am using VS Code to debug a php file. I have installed the PHP Debug extension and configured PHP to debug using XDebug. Server is Apache (using Xampp).
    The file I want to debug is in .../htdocs/Nuurdwind and breakpoints are hit. All is fine. But when I open another folder (for instance .../htdocs/ReitenMV_Bs) and try to debug a file that is located in this folder, breakpoints are not hit, i.e. the program is finished without stopping at any breakpoint.
    Pressing F5 does not provide that line "Listen for XDebug (ReitenMV_BS)" at the bottom of the screen.
    My setting in php.ini are these:
    [xdebug]
    xdebug.remote_enable=1
    xdebug.remote_autostart=1
    xdebug.remote_host=localhost
    xdebug.remote_port=9000
    xdebug.remote_handler="dbgp"
    xdebug.remote_mode=req
    xdebug.profiler_enable = 1
    xdebug.profiler_output_dir = "c:/temp"
    xdebug.collect_params = 4
    xdebug.collect_return = on
    xdebug.collect_vars = on
    xdebug.show_local_vars = 1
    xdebug.remote_log = "c:/XdebugRemote_log.log
    zend_extension = C:\xampp\php\ext\php_xdebug-2.7.2-7.3-vc15-x86_64.dll

    Why does it depend on the folder and what settings are required to make xdebug work on any folder?

    Jan Lübeck
    @jlubeck

    When hitting an error on my project, I'm getting this error: Unable to open 'CheckUserRole.php': Unable to read file (Error: File not found (/home/vagrant/checker/app/Http/Middleware/CheckUserRole.php)).

    Now, that file exists on the vagrant file, but on my local computer it's a different route. It looks like the pathMappings are not working for some reason.. any idea how that can be fixed?

    Henry
    @Henry69_gitlab
    Somewhere in this chatroom it has been mentioned that php version 7.3 is not good. I reinstalled XAMPP. Instead of using xampp-windows-x64-7.3.7-0-VC15-installer.exe I chose vs. 7.1 (xampp-portable-windows-x64-7.1.31-2-VC14-installer.exe). It works. So hopefully the 'never-ending-story' has come to an end.
    Henry
    @Henry69_gitlab
    The folder .vscode with launch.json was missing. I copied it from another folder and that solved the problem (hopefully forever).
    Mark Carpenter Jr
    @mcarpenterjr
    Anyone else on VSCode V1.38-insiders and suddenly have an issue with php-debug connect to the xdebug process but not attach to the editor? I have an issue where if php-debug is active it will connect to xdebug and pause the request queue but never enters the document loaded in VSCode. I was able to debug on friday before I left for the weekend. Thoughts?
    Mark Carpenter Jr
    @mcarpenterjr
    :point_up: Nevermind, I was able to fix the issue by updating the browser.
    justlevine
    @justlevine
    Is there a way to use profile_enable_trigger via launch.json?
    DanielF
    @DanielFloris
    Has anyone got this running using Remote-WSL with vscode? I've always used this on WSL and vscode and its worked great, but switching to remote-wsl means all breakpoints aren't hitting.
    Chang Shu-huai
    @junsuwhy

    Has anyone know why vscode doesn't do any thing for listen to the port after I run "start debugging" .I have set up launch.json finished. My OS is windows 10 and I have used resmon.exe to see what port is listening. But there are no any "code.exe" listen to port 9000.
    I have already access any port on "Code.exe" via my firewall software (McAfee).
    My launch.json like this:

    {
      "version": "0.2.0",
      "configurations": [
        {
          "name": "Listen for XDebug",
          "type": "php",
          "request": "launch",
          "port": 9000,
          "pathMappings": {
            "/var/www/html/": "${workspaceFolder}"
          },
          "log":true
        }
      ]
    }

    The only debug message:

    <- launchResponse
    Response {
      seq: 0,
      type: 'response',
      request_seq: 2,
      command: 'launch',
      success: true }

    After "Start Debugging" the stop button symbol on debug panel is always only frame line, not solid.
    debug panel

    Chang Shu-huai
    @junsuwhy
    I think I know the answer. My project is remote SSH project. It works on my local project.
    Dmitrij Rebrov
    @Aliaric
    Im trying to run vscode + xdebug + docker with browser extension on macos
       {
            "name": "Listen for XDebug",
            "hostname": "localhost",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "pathMappings": {
                "/application/public": "${workspaceRoot}/public"
            }
        },
    xdebug.remote_enable=on
    xdebug.remote_connect_back=1
    xdebug.remote_port=9000
    xdebug.remote_host = docker.for.mac.localhost
    xdebug.remote_handler=dbgp
    ; xdebug.remote_log="/var/log/xdebug.log"
    xdebug.remote_autostart = on
    xdebug.idekey=VSCODE
    xdebug.var_display_max_children = -1
    xdebug.var_display_max_data = -1
    xdebug.var_display_max_depth = -1
    I dunno whato to do. It just does not connect
    no reaction
    Dmitrij Rebrov
    @Aliaric
    xdebul log:
    [6] Log opened at 2019-09-08 13:04:57
    [6] I: Checking remote connect back address.
    [6] I: Checking header 'HTTP_X_FORWARDED_FOR'.
    [6] I: Checking header 'REMOTE_ADDR'.
    [6] I: Remote address found, connecting to 172.28.0.1:9000.
    [6] W: Creating socket for '172.28.0.1:9000', poll success, but error: Operation now in progress (29).
    [6] E: Could not connect to client. :-(
    [6] Log closed at 2019-09-08 13:04:57
    Solution is:
    Dmitrij Rebrov
    @Aliaric
    xdebug.remote_connect_back=0
    gopal-et
    @gopal-et
    Hi, I am new to whole php debug and these tool , I am trying to implement xdebug on laradock using this tutorial
    https://medium.com/full-stack-development/laradock-xdebug-ms-code-no-problem-35a4338deb3f
    Can some one suggest what should be the path mappings for a laravel project
    is it till path/laravel-project or path/laravel-project/public
    BjarneFred
    @BjarneFred
    Does anyone have any experience using this with laragon? I can't get xdebug to work and I think it is something to do with the pathMappings.