我正在尝试将Xdebug设置为在基于灯塔/ Laravel的服务器的视窗环境下工作在VSCode中。我的VSCode设置如下所示
{
// 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
}
]
}我还尝试向其中添加一个pathMappings,但没有成功
"pathMappings": {
"/graphql": "${workspaceRoot}/public"
}我遵循了https://laracasts.com/series/visual-studio-code-for-php-developers/episodes/13,并添加了所有建议的配置。当我输入php -v时
PHP 7.4.10 (cli) (built: Sep 1 2020 16:52:21) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.0, Copyright (c) 2002-2020, by Derick Rethans我确实看到安装了Xdebug。我的php.ini看起来像这样
[XDebug]
zend_extension = "php_xdebug-3.0.0-7.4-vc15-nts-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_host=localhost
xdebug.idekey=VSCODE
xdebug.remote_log ="C:\tools\xdebug.log"如有任何建议,我们将不胜感激
发布于 2020-12-02 20:10:12
对于其他有类似问题的人,只需升级我的php.ini即可。
[XDebug]
zend_extension = "php_xdebug-3.0.0-7.4-vc15-nts-x86_64.dll"
xdebug.mode = debug
xdebug.start_with_request=yes
xdebug.idekey=VSCODE结果就像这样,甚至不确定现在是否有必要使用idekey。将端口更改为9003,这在版本3中发生了明显的变化。
https://stackoverflow.com/questions/65106857
复制相似问题