我没有使用我的phpstorm 2021.1.4在Xdebug中调试Laravel 8应用程序
我尝试使用我的phpstorm 2021.1.4在Xdebug中调试我的Laravel 8应用程序 我已经在本地ubuntu 20 OS中安装了Xdebug:
$ php -v
PHP 8.1.4 (cli) (built: Apr 4 2022 13:30:17) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.4, Copyright (c) Zend Technologies
with Zend OPcache v8.1.4, Copyright (c), by Zend Technologies
with Xdebug v3.1.2, Copyright (c) 2002-2021, by Derick Rethans
我在 /etc/php/8.1/apache2/conf.d/20-xdebug.ini
中添加了参数:
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
xdebug.idekey=PHPSTORM
xdebug.default_enable = 1
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9003
implicit_flush= On
; xdebug.remote_handler="dbgp"
但是我不确定哪些参数必须在这个文件中?我在Google中进行了搜索,在不同情况下,此信息有所不同。
在控制台中运行服务器:
php artisan serve
我使用URL在Chrome浏览器中运行该应用程序:
http://127.0.0.1:8000
我已经安装了Chrome Xdebug扩展名: https:// https:////// prnt.sc/ibi42ssbkstr 我希望当我刷新此页面时,我的phpstorm将停止流动,并将打开断裂点。
在phpstorm中,我有设置: https://prnt.sc/wgysoleusjbf 使用调试端口9003和上面的文件中。
和主页上断: https://prnt.sc/mmsz5kmioyn17 and: https://prnt.sc/gkijtxj2llrb
有什么问题?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需要
20-xdebug.ini
中的以下内容:但是,我将使用
xdebug.mode =开发,debug
而不是。其他设置要么已经是默认设置(
xdebug.client_host = 127.0.0.0.1
,xdebug.client_port = 9003
),要用于Xdebug的旧版本(2)(xdebug.remote*和
xdebug.default_enable
)。如果安装浏览器扩展程序,则仍然需要单击其中的图标,以启用调试。
如果这不起作用,那么您可以尝试使用其中的
xdebug_info()
在其中(例如,在您的index.php文件中)进行调试。然后,如果指示连接到您的IDE,这将告诉您启用了哪些模式,以及Xdebug尝试执行的操作。如果也没有提供足够的信息,则可以设置
xdebug.log =/tmp/xdebug.log
和xdebug.log_level = 10
,然后停止,重新启动,重新启动<<代码> PHP Artisan Server ,然后在浏览器中重新加载页面,它应该包含大量信息,内容涉及脚本开始期间发生的事情,Xdebug将检查参数等,并尝试连接到您的IDE 。You would only need the following in
20-xdebug.ini
:I would however use
xdebug.mode=develop,debug
instead.The other settings are either already the default (
xdebug.client_host=127.0.0.1
,xdebug.client_port=9003
) or for an older version (2) of Xdebug (xdebug.remote*
andxdebug.default_enable
).If you install the browser extension, you still need to click the icon in it, to enable debugging.
If this does not work, then you can try debugging a page with
xdebug_info()
in it (in your index.php file, for example). This will then tell you which modes are enabled, and what Xdebug tried to do, if instructed to connect to your IDE.If that also does not provide enough information, you can set
xdebug.log=/tmp/xdebug.log
andxdebug.log_level=10
, and then after stopping, restartingphp artisan server
, and reloading a page in the browser it should contain a wealth of information of what went on during the start of your script, where Xdebug would check for parameters etc, and try to connect to your IDE.