macos - mac上如何用vscode调试php代码?
巴扎黑
巴扎黑 2017-04-11 10:22:49
0
0
621

xdebug扩展已经安装了,断点能正常加上,debugger启动后报错如下:

listen EADDRINUSE :::9000

默认配置:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000
        },
        {
            "name": "Launch currently open script",
            "type": "php",
            "request": "launch",
            "program": "${file}",
            "cwd": "${fileDirname}",
            "port": 9000
        }
    ]
}

报错原因是端口9000被使用了,我把配置中的端口改成9001,能够正常启动debugger。但是无论如何都不会命中断点。不论是用localhost还是localhost:9001访问都无法命中断点。
前提是:

  1. lsof -i:9000发现并没有进程在监听9000端口,启动debugger的时候却报了EADDRINUSE:::9000的错误

  2. mac上的防火墙是关闭的

巴扎黑
巴扎黑

reply all(0)
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!