如何使用 PhpStorm 调试 Laravel 应用程序

发布于 2025-01-09 23:19:30 字数 587 浏览 2 评论 0 原文

我正在使用带有 Xdebug 扩展的 PHP 8.1 开发 Laravel 8.6 应用程序,但我无法让 PhpStorm 的调试工具正常工作。

这是我的调试配置。请注意,我使用的是虚拟主机

在此处输入图像描述

PhpStorm 正在侦听 PHP 调试连接,我在端点设置了断点,但是当我通过 Postman 发出 http 请求时,什么也没有发生。我做错了什么?

php.ini

zend_extension=C:\xampp\php\ext\php_xdebug.dll
xdebug.mode=debug
xdebug.remote_enable = 1
xdebug.remote_host = "api-fitplanner.localhost"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_port=9003

I'm developing a Laravel 8.6 application using PHP 8.1 with Xdebug extension but I can't get the PhpStorm's debugging tool to work.

Here's my debug configuration. Notice that I'm using a virtual host

enter image description here

PhpStorm's is listening for PHP debug connections and I set a breakpoint to an endpoint but when I make the http request via Postman nothing happens. What am I doing wrong?

php.ini

zend_extension=C:\xampp\php\ext\php_xdebug.dll
xdebug.mode=debug
xdebug.remote_enable = 1
xdebug.remote_host = "api-fitplanner.localhost"
xdebug.remote_autostart=on
xdebug.remote_enable=on
xdebug.remote_port=9003

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

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

发布评论

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

评论(1

泛滥成性 2025-01-16 23:19:30

您正在使用 Xdebug 2 设置,但正在运行 Xdebug 3.1.3。请参阅升级指南了解如何转换这些内容。

从你上面写的来看,应该是:

zend_extension=C:\xampp\php\ext\php_xdebug.dll
xdebug.mode=develop,debug
xdebug.client_host="api-fitplanner.localhost"
xdebug.start_with_request=yes

You are using Xdebug 2 settings, but you are running Xdebug 3.1.3. Please refer to the upgrade guide on how to convert these.

From what you wrote above, it should be:

zend_extension=C:\xampp\php\ext\php_xdebug.dll
xdebug.mode=develop,debug
xdebug.client_host="api-fitplanner.localhost"
xdebug.start_with_request=yes

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