为了账号安全,请及时绑定邮箱和手机立即绑定

使用 VS Code 调试 php:无法附加到浏览器

使用 VS Code 调试 php:无法附加到浏览器

PHP
qq_笑_17 2023-11-03 16:51:53
我已经按照此处的说明安装了 xdebug:http://xdebug.org/wizard我还安装了 Chrome 扩展调试器现在我选择 index.php 文件并启动调试器,但出现以下错误:这是lunch.json的内容这是我添加到 php.ini 的配置xdebug.remote_enable = 1xdebug.remote_autostart = 1zend_extension = /usr/lib/php/20170718/xdebug.so更新:我已添加xdebug.remote_log=/tmp/xdebug.log到 php.ini,这是我收到的错误:[3569] I: Connecting to configured address/port: localhost:9000.[3569] W: Creating socket for 'localhost:9000', poll success, but error: Operation now in progress (29).[3569] E: Could not connect to client. :-(
查看完整描述

1 回答

?
30秒到达战场

TA贡献1828条经验 获得超6个赞

Lunch.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": 9000

        },

        {

            "name": "Launch currently open script",

            "type": "php",

            "request": "launch",

            "program": "${file}",

            "cwd": "${fileDirname}",

            "port": 9000,

            "runtimeExecutable": "/usr/bin/php.exe"

        }

    ]

}


查看完整回答
反对 回复 2023-11-03
  • 1 回答
  • 0 关注
  • 88 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信