php中没有launch,启动当前打开的脚本无法在PHP Debug Adapter for Visual Studio Code中使用...

我正在尝试使用vscode调试php cli脚本和php-debug extension所以我在脚本中添加了一些断点并播放 Launch currently open script 但是调试工具栏只显示片刻并隐藏 .

这是launch.json配置

{

"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

}

]

}

配置xdebug日志后,我收到此消息

日志打开2018-08-01 03:57:01 I:连接到已配置的地址/端口:127.0.0.1:9000 . W:为'127.0.0.1:9000'创建套接字,轮询成功,但错误:正在进行操作(29) . E:无法连接到客户端 . :-(日志关闭于2018-08-01 03:57:01

我读到了这个问题,建议更改端口

按照建议我在 20-xdebug.ini 和 launch.json 文件中更改xdebug端口,但没有成功 . 我分享了文件的内容

/etc/php/7.2/cli/conf.d/20-xdebug.ini

xdebug.show_error_trace = 1

xdebug.remote_enable=1

xdebug.remote_host=127.0.0.1

xdebug.remote_handler=dbgp

xdebug.remote_port=9001

xdebug.remote_autostart=1

xdebug.remote_log=/var/log/xdebug.log

launch.json

{

"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": 9001

}

]

}

重新启动日志文件中的apache和vscode后,我收到此消息

Log opened at 2018-08-01 04:07:01

I: Connecting to configured address/port: 127.0.0.1:9001.

W: Creating socket for '127.0.0.1:9001', poll success, but error: Operation now in progress (29).

E: Could not connect to client. :-(

Log closed at 2018-08-01 04:07:01

谢谢你的任何建议

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值