簡體   English   中英

“啟動當前打開的腳本”不起作用,但“啟動 Xdebug”工作正常。 VSCode + PHP + Xdebug

[英]"Launch currently open script" dosn't work, but "Launch for Xdebug" works fine. VSCode + PHP + Xdebug

“啟動當前打開的腳本”不起作用。 當我點擊播放按鈕時,它需要幾秒鍾然后停止而不說什么。 我配置了“Launch for Xdebug”,它工作正常。

我正在使用來自 Xdebug 的 vscode、xdebug 3.1.5、php7.4、xampp、wordpress、vscode 擴展“PHP 調試”

我的launch.json

"configurations": [
    {
        "name": "Listen for Xdebug",
        "type": "php",
        "request": "launch",
        "port": 9003
    },
    {
        "name": "Launch currently open script",
        "type": "php",
        "request": "launch",
        "program": "${file}",
        "cwd": "${fileDirname}",
        "port": 9003,
        "runtimeArgs": [
            "-dxdebug.start_with_request=yes"
        ],
        "env": {
            "XDEBUG_MODE": "debug,develop",
            "XDEBUG_CONFIG": "client_port=${port}"
        }
    },

    ...
]

我的php.ini

[XDebug]
zend_extension=xdebug
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.mode=debug
xdebug.remote_port=9003
xdebug.start_with_request=yes
xdebug.remote_log="C:\xampp\apache\logs\xdebug_remote.log"
xdebug.log="C:\xampp\apache\logs\xdebug.log"

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM