使用Intellij配置Xdebug不起作用

问题描述 投票:1回答:2

我花了几个小时让XDebug与Intellij合作,但遗憾的是没有运气。

我的设置如下。我在Windows 7机器上,我安装了Intellij 12。我的PHP站点在Vmware虚拟Linux(debian)盒子上运行。

我在php.ini中配置了以下Xdebug设置。

; xdebug settings
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.profiler_enable=1
;xdebug.profiler_output_dir="/usr/lib/php5/xdebug-output"
xdebug.remote_host=192.168.1.71
xdebug.show_exception_trace=On
xdebug.remote_handler=dbgp
xdebug.remote_connect_back=1
  • 192.168.1.71是我的虚拟服务器的IP,但我也尝试过www.local-example.com。
  • 该网站运行正常(我将IP映射到www.local-example.com)
  • phpinfo()告诉我PHP配置了xdebug :( Zend Engine v2.3.0,版权所有(c)1998-2010 Zend Technologies with Xdebug v2.2.3,Copyright(c)2002-2013,作者:Derick Rethan
  • 当我var_dump的东西,它被xdebug很好地格式化,所以这部分工作。
  • 我通过http://xdebug.org/wizard.php的向导运行我的phpinfo()输出,并按照向我建议的步骤成功完成。
  • 我很好地浏览了这里的流程图:https://netbeans.org/project_downloads/www/php/debug-setup-flowchart.pdf
  • 我将脚本复制到以下url并从命令行运行:https://blogs.oracle.com/netbeansphp/entry/howto_check_xdebug_installation。当我启动脚本时没有真正发生的事情,所以我想它正在监听连接(我不太懂Linux)。当我随后使用XDEBUG_SESSION_START = mysession参数请求我的网站页面之一时,页面加载,但速度很慢。

当我在PHP.ini中启用xdebug设置时,真正发生的一切就是我的网站变得很慢。

你可能想知道为什么我把Intellij放在标题中。我试图从Intellij连接到xdebug。但是我已经离开了intellij,因为我觉得我的基本xdebug设置有问题。

非常感谢您的帮助。

intellij-idea xdebug
2个回答
0
投票

您使用的IP应该是运行IDE的计算机的IP - 而不是使用PHP / Xdebug的IP。 Xdebug充当客户端,IDE充当服务器,为了让Xdebug连接到IDE /服务器,它需要知道它的IP地址。

或者,您可以设置xdebug.remote_conneck_back = 1以让Xdebug使用发出浏览器请求的计算机的IP(通常与使用IDE的计算机/ IP相同)。


1
投票

在windows wamp上的smartJ IDEA上的xdebug的正确设置是在底部查找php.ini文件找到xdebug,

[xdebug]
xdebug.remote_enable = On
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9001
xdebug.remote_handler=dbgp
xdebug.remote_autostart=0
© www.soinside.com 2019 - 2024. All rights reserved.