【发布时间】:2013-07-02 21:56:59
【问题描述】:
我花了几个小时让 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,版权所有 (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