domenica 7 marzo 2021

Can't debug php with XDebug

My php with VS seems to run but does not stop at break point, this solve the issue. 

https://stackoverflow.com/questions/4021964/xdebug-wont-stop-at-breakpoint

https://www.youtube.com/watch?v=LNIvugvmCyQ


php.ini

[XDebug]

zend_extension = "C:/xampp/php/ext/php_xdebug.dll"

xdebug.remote_enable = 1

xdebug.remote_autostart = 1

xdebug.remote_enable=1

xdebug.default_enable=0

xdebug.profiler_enable=0

xdebug.auto_trace=0

xdebug.coverage_enable=0

xdebug.mode=debug

xdebug.start_with_request=yes

launch.json

{
    // 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": 9003
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "runtimeExecutable": "C:\\xampp\\php\\php.exe",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9003
        }
    ]
}


Similar problem here when I migrated from Xdebug 2 to 3.

There is a documentation for that but the most important points are:

Xdebug's default debugging port has changed from 9000 to 9003.

To make sure that just Step Debugging is active, instead of:

xdebug.remote_enable=1
xdebug.default_enable=0
xdebug.profiler_enable=0
xdebug.auto_trace=0
xdebug.coverage_enable=0

You now only do:

xdebug.mode=debug

The xdebug.remote_autostart setting has been removed. Instead, set

xdebug.start_with_request=yes

Nessun commento:

Posta un commento

Red Hat xrdp machine login screen freeze after writing the password

I've encountered and issue while connecting from a Windows Server 2014  to a remote machine (VM) using XRDP  through Windows Remote Desk...