调试在PhpStorm中无法与虚拟机上的服务器配合使用 [英] Debug not working in PhpStorm with server on VM

查看:281
本文介绍了调试在PhpStorm中无法与虚拟机上的服务器配合使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VirtualBox上设置了一台Debian服务器,所有东西都运行得很好,除了XDEBUG无法启动。在服务器上,我安装了symfony 3应用程序,它使用vhost admin.localwww.pl和HTTPS。

我的php -v结果:

PHP 7.3.31-2+0~20211022.89+debian11~1.gbp745ac7 (cli) (built: Oct 22 2021 12:37:38) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.31, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.31-2+0~20211022.89+debian11~1.gbp745ac7, Copyright (c) 1999-2018, by Zend Technologies
    with Xdebug v3.1.1, Copyright (c) 2002-2021, by Derick Rethans

我的xdebug.ini

zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_host=127.0.0.1
xdebug.remote_port = 9003
xdebug.idekey = PHPSTORM
xdebug.mode=debug
xdebug.show_error_trace = 1
xdebug.remote_autostart = 1

我的PhpStorm设置:

当我运行PHP远程调试配置时,我看到以下内容:

无论我是将?XDEBUG_SESSION_START=PHPSTORM添加到URL,还是在Google Chrome中使用XDEBUG Helper,效果都是一样的:尽管设置了断点,但没有任何反应。

我从位于VM上的远程服务器使用PHP CLI:


编辑:我当前的配置仍然不起作用:

zend_extension=xdebug.so
xdebug.idekey=PHPSTORM
xdebug.mode=develop,debug
xdebug.start_with_request=yes
xdebug.client_host=127.0.0.1
xdebug.client_port = 9003

推荐答案

您的所有设置都指向XDEBUG 2设置,您使用的是XDEBUG 3.1.1-请阅读升级指南:https://xdebug.org/docs/upgrade_guide

这篇关于调试在PhpStorm中无法与虚拟机上的服务器配合使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆