美文网首页
在vscode中使用xdebug调试php代码

在vscode中使用xdebug调试php代码

作者: 罗盘上的方向 | 来源:发表于2018-06-26 10:34 被阅读26次

我使用的是lnmp环境,默认情况下9000端口被php-fpm占用,所以把xdebug监听的端口修改为9090,并把vscodelaunch.json里面的端口也对应修改为9090,即可!
php.inixdebug节下添加如下代码


[XDebug]

zend_extension = 'xdebug.so'

xdebug.remote_enable =1

xdebug.remote_autostart = 1

xdebug.remote_port = 9090

//launch.json


{

    // 使用 IntelliSense 了解相关属性。

    // 悬停以查看现有属性的描述。

    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387

    "version": "0.2.0",

    "configurations": [

        {

            "name": "Listen for XDebug",

            "type": "php",

            "request": "launch",

            "port": 9090

        },

        {

            "name": "Launch currently open script",

            "type": "php",

            "request": "launch",

            "program": "${file}",

            "cwd": "${fileDirname}",

            "port": 9090

        }

    ]

}

相关文章

网友评论

      本文标题:在vscode中使用xdebug调试php代码

      本文链接:https://www.haomeiwen.com/subject/qpepyftx.html