我一直在使用eclipse-pdt与xdebug和apache一起使用超过一年.事情完美无缺,我可以在eclipse中完成我想要的所有交互式调试(使用我自己的机器作为服务器).
现在我从apache切换到nginx(因此PHP现在不是作为Apache服务而是作为fast-cgi运行)而且我找不到一种方法来配置eclipse与xdebug很好地协同工作.我不确定xdebug或eclipse(或两者)的问题是否确定.
在eclipse配置中,我已经将对PHP配置文件的引用更改为/etc/php5/cli/php.ini.
使用以下php.ini文件
zend_extension=/usr/lib/php5/20060613/xdebug.so
Run Code Online (Sandbox Code Playgroud)
var_dump()我得到它的xdebug版本,而不是普通的PHP版本)...?XDEBUG_SESSION_START=ECLIPSE_DBGP&KEY=...,但程序执行不会在断点处停止如果我使用该文件的其他版本(在切换到nginx之前它是有效的):
zend_extension=/usr/lib/php5/20060613/xdebug.so
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_mode=req
Run Code Online (Sandbox Code Playgroud)
我根本无法访问我网站的任何页面.
PS:我机器上的附加数据: - 操作系统: GNU/Linux - Ubuntu 9.10 64位.- PHP: 5.2.10-2ubuntu6.3,带Suhosin-Patch 0.9.7; Zend Engine v2.2.0,版权所有(c)1998-2009 Zend Technologies with Xdebug v2.0.4 - Eclipse:见截图.

我不确定我什么时候或者我改变了什么,但突然xdebug不再呈现其格式化的堆栈跟踪.相反,它渲染stacktrtace没有任何HTML; 这是一个例子 ; 虽然我希望像这里的橙色表
我搜索了文档,但找不到任何对(un)设置它的设置或配置的引用.我做错了什么?
我的xdebug.ini(Ubuntu,所以/etc/php5/conf.d/xdebug.ini)很小:
zend_extension=/usr/lib/php5/20090626+lfs/xdebug.so
xdebug.default_enable = 1
xdebug.auto_trace = 1
xdebug.remote_enable = 1
xdebug.remote_port = 9010
xdebug.remote_host = audrey
; xdebug.profiler_enable = 1
; Markup of var_dump
xdebug.overload_var_dump = 1
Run Code Online (Sandbox Code Playgroud) 如果在整个代码库中存在日志记录语句,如何设置记录器,以便在将代码部署到生产环境中时不必注释掉对记录器的每次调用?
这是我目前的代码:
import logging
logging.basicConfig(filename='./example.log', level=logging.DEBUG,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%m-%d %H:%M')
logging.debug('debug failed')
logging.info('info failed')
logging.warning('A warning')
Run Code Online (Sandbox Code Playgroud) 我正在尝试远程调试一个php web应用程序但是无论何时我尝试启动一个调试会话Eclipse都会给我带来一堆弹出窗口:
调试器错误:"找不到合适的文件或没有选择文件.调试已终止".

这是我目前的Xdebug 2.2.1配置:
[xdebug]
xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
Run Code Online (Sandbox Code Playgroud)
这是我的Eclipse 4.2.1调试配置:

Xdebug已正确安装,我在phpinfo()输出中看到它已启用.
当项目在使用Vagrant的本地虚拟机内运行时,这个问题是关于让XDebug在PHPStorm中工作.到目前为止,我还没有找到任何有关如何运行的综合手册.适用于PHPStorm 7.0.
我希望在答案中涵盖的内容:
我希望这可能是一个有用的指南,可以让XDebug在Vagrant中运行PHPStorm.
我正在使用Eclipse开发Android应用程序.当我正在调试时,事情似乎顺利进行,然后Eclipse似乎挂断了 - 一个"无响应"错误.我查看了日志文件,每隔3秒就会收到此超时错误.有人见过这个吗?
我必须继续重启我的机器.
!ENTRY org.eclipse.jdt.debug 4 125 2014-03-12 10:18:19.417
!MESSAGE Internal error logged from JDI Debug:
!STACK 0
org.eclipse.jdi.TimeoutException: Timeout occurred while waiting for packet 12963.
at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:186)
at org.eclipse.jdi.internal.connect.PacketReceiveManager.getReply(PacketReceiveManager.java:197)
at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:191)
at org.eclipse.jdi.internal.MirrorImpl.requestVM(MirrorImpl.java:226)
at org.eclipse.jdi.internal.VirtualMachineImpl.classesBySignature(VirtualMachineImpl.java:638)
at org.eclipse.jdi.internal.VirtualMachineImpl.classesByName(VirtualMachineImpl.java:667)
at org.eclipse.jdt.internal.debug.core.model.JDIDebugTarget.jdiClassesByName(JDIDebugTarget.java:1596)
at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.filterUnloadedTypes(JavaHotCodeReplaceManager.java:348)
at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager.notifyUnsupportedHCR(JavaHotCodeReplaceManager.java:379)
at org.eclipse.jdt.internal.debug.core.hcr.JavaHotCodeReplaceManager$2.run(JavaHotCodeReplaceManager.java:322)
at org.eclipse.debug.core.DebugPlugin$AsynchRunner.run(DebugPlugin.java:1068)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.debug.core.DebugPlugin$AsynchRunner.async(DebugPlugin.java:1051)
at org.eclipse.debug.core.DebugPlugin$EventDispatchJob.run(DebugPlugin.java:405)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
!SESSION 2014-03-12 10:30:21.771 -----------------------------------------------
eclipse.buildId=M20130204-1200
java.version=1.7.0_51
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64
Run Code Online (Sandbox Code Playgroud) 我试图用xdebug执行phpunit代码覆盖,如下所示,
C:\wamp\bin\php\php5.3.22>phpunit -coverage-html /tmp C:\<unittest file pat>\TestRetainer.php
Run Code Online (Sandbox Code Playgroud)
它输出如下,
PHPUnit 3.7.32 by Sebastian Bergmann.
....
Time: 36 ms, Memory: 5.75Mb
OK (4 tests, 12 assertions)
C:\wamp\bin\php\php5.3.22>
Run Code Online (Sandbox Code Playgroud)
但我无法找到报告文件的html版本.
我已经浏览了这个网址http://phpunit.de/manual/current/en/phpunit-book.html#code-coverage-analysis.但我没有找到任何运气.
请帮帮我.
当我尝试运行xdebug分析(从命令行)时,脚本立即死亡.我没有收到任何反馈.(如果我在关闭xdebug profiling的情况下运行脚本,那么脚本就会像我期望的那样执行.)我在Centos 6中运行php 5.4.13.
我尝试了两种不同的方法来启用分析:编辑php.ini,并在执行脚本时使用-d标志.
我的php.ini的相关部分如下所示:
[xdebug]
zend_extension="/usr/lib64/php/modules/xdebug.so"
xdebug.remote_enable = 1
xdebug.default_enable = 0
xdebug.profiler_output_dir = "/tmp/profiling"
# xdebug.profiler_enable = 1 # I uncomment this line to try to profile my script
Run Code Online (Sandbox Code Playgroud)
我使用这两个命令之一调用脚本(并确保ini文件行被注释掉(或不符合)).
$> /usr/bin/php scripts/daemon/PostProcess.php -c 4
Run Code Online (Sandbox Code Playgroud)
要么
$> /usr/bin/php -d xdebug.profiler_enable=1 scripts/daemon/PostProcess.php -c 4
Run Code Online (Sandbox Code Playgroud)
我确信正在正确解释设置.
$> php -d xdebug.profiler_enable=1 --info | grep profile | less
xdebug.profiler_aggregate => Off => Off
xdebug.profiler_append => Off => Off
xdebug.profiler_enable => On => On
xdebug.profiler_enable_trigger => Off => Off
xdebug.profiler_output_dir => /tmp/profiling …Run Code Online (Sandbox Code Playgroud) 我正在使用xdebug来调试phpstorm的php应用程序.大多数时候调试工作.但是,我反复观察到以下行为:

这几乎就像浏览器认为它在断点处停止一样,即使它不是.关闭和重新开启风暴会暂时解决问题,但问题总是会重新出现.单击"停止侦听传入连接"可以加载页面,但当然可以防止我放入断点.这种行为仍然存在,即使我做添加断点,这是说,我的断点完全被忽略.
如果它有帮助,这是我的xdebug配置,我正在运行从这里下载的php5.5.