Xdebug在Vscode Laravel项目中不工作

发布于 2025-01-27 09:43:39 字数 837 浏览 3 评论 0原文

我安装了Xdebug并使用phpinfo()进行了检查。

我尝试使用“启动当前打开脚本”选项调试public/index.php,并且效果很好。

定义测试路线,一个控制器,我启动了“收听Xdebug”选项,然后我在浏览器中转到了该URL。但是在预选的断点上什么都没有发生。

启动。json

    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
            "log": true
        },

xdebug.ini

zend_extension=xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9003
  • php 7.2
  • laravel 5.6
  • ubuntu 20.04
  • xdebug 3.1.2

I installed Xdebug and checked with phpinfo().

I tried debugging public/index.php with "Launch currently open script" option and it worked fine.

Defining a route for testing, a controller, I started the "Listen for Xdebug" option, and then, I went to that url in my browser. But nothing happens at the preselected breakpoint.

launch.json

    "configurations": [
        {
            "name": "Listen for Xdebug",
            "type": "php",
            "request": "launch",
            "port": 9003,
            "log": true
        },

xdebug.ini

zend_extension=xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9003
  • PHP 7.2
  • Laravel 5.6
  • Ubuntu 20.04
  • Xdebug 3.1.2

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

娜些时光,永不杰束 2025-02-03 09:43:39

您正在使用Xdebug 3.1.2。但是您所有的设置仍然适用于Xdebug 2。 。要使用Xdebug 3设置从上方复制Xdebug 2设置,请使用:

zend_extension=xdebug.so

xdebug.start_with_request=yes
;xdebug.remote_autostart = 1

xdebug.mode=develop,debug
;xdebug.remote_enable = 1

; This one has been removed:
;xdebug.remote_handler = dbgp

; These are defaults, so you don't need to set them. They aso have been renamed:
;xdebug.remote_host = 127.0.0.1
;xdebug.remote_port = 9003
;xdebug.remote_mode = req

xdebug.log=/tmp/xdebug_remote.log
;xdebug.remote_log = /tmp/xdebug_remote.log

简称:

zend_extension=xdebug.so
xdebug.mode=develop,debug
xdebug.start_with_request=yes
xdebug.log=/tmp/xdebug_remote.log

You are using Xdebug 3.1.2. but all your settings are still for Xdebug 2. There is a handy upgrade guide that you most definitely should read. To replicate the Xdebug 2 settings from above with Xdebug 3 settings, use:

zend_extension=xdebug.so

xdebug.start_with_request=yes
;xdebug.remote_autostart = 1

xdebug.mode=develop,debug
;xdebug.remote_enable = 1

; This one has been removed:
;xdebug.remote_handler = dbgp

; These are defaults, so you don't need to set them. They aso have been renamed:
;xdebug.remote_host = 127.0.0.1
;xdebug.remote_port = 9003
;xdebug.remote_mode = req

xdebug.log=/tmp/xdebug_remote.log
;xdebug.remote_log = /tmp/xdebug_remote.log

Or in short:

zend_extension=xdebug.so
xdebug.mode=develop,debug
xdebug.start_with_request=yes
xdebug.log=/tmp/xdebug_remote.log
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文