首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Laravel Lighthouse环境下设置VSCode和Xdebug

在Laravel Lighthouse环境下设置VSCode和Xdebug
EN

Stack Overflow用户
提问于 2020-12-02 19:07:42
回答 1查看 181关注 0票数 0

我正在尝试将Xdebug设置为在基于灯塔/ Laravel的服务器的视窗环境下工作在VSCode中。我的VSCode设置如下所示

代码语言:javascript
复制
{
    // 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,但没有成功

代码语言:javascript
复制
"pathMappings": {
            "/graphql": "${workspaceRoot}/public"
        }

我遵循了https://laracasts.com/series/visual-studio-code-for-php-developers/episodes/13,并添加了所有建议的配置。当我输入php -v时

代码语言:javascript
复制
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看起来像这样

代码语言:javascript
复制
[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"

如有任何建议,我们将不胜感激

EN

回答 1

Stack Overflow用户

发布于 2020-12-02 20:10:12

对于其他有类似问题的人,只需升级我的php.ini即可。

代码语言:javascript
复制
[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中发生了明显的变化。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65106857

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档