我正在使用 windows xp x86、wamp、apache2、php 5.3 x86、eclipse php 和 xdebug,在 localhost 上作为虚拟主机和 https 虚拟主机运行
eclipse版本信息
面向 PHP 开发人员的 Eclipse
版本:Helios 发布
内部版本号:20100617-1415
不知何故,我成功地设置了 eclipse 和 xdebug,一切都很好。
然后我必须为我的项目创建一个 svn 分支,并使用 2 个新的虚拟主机重新配置 apache,并更新我的 windows 主机文件。
现在,当我在 eclipse 中启动 Debug模式时,一切都死了。
具体来说, 如果我没有设置断点,则应用程序运行良好,请先解决我尝试调试的问题。
如果我设置了一个断点,应用程序会在断点处停止,并且 eclipse 似乎正在控制球。但是现在,当我按下继续,或跳过,或进入,或打喷嚏时,eclipse 告诉我执行已恢复,但应用程序继续挂起,我必须重新启动 apache。
我怀疑 eclipse 和 xdebug 之间的通信出现了一些中断,因为在我看来 eclipse 正在发送我的 continue 或 step over 命令,但 xdebug 没有收到它。
但即使是这样,我也不知道该怎么办。我应该去哪里看?
更新:
我已经成功地能够使用notepad++、它的xdebug插件进行调试,并且像一个穴居人一样,在url中输入&XDEBUG_SESSION_START=session_name。然而,尽管我很喜欢 npp,但它的调试插件还是有问题的......
所以我注意到 stackoverflow 上有一个名为“phpstorm”的广告,它自称是一个轻量级但功能齐全的 php ide,具有原生 xdebug 支持。该演示需要重新启动才能使其工作,感觉有点像在摇摆不定的草稿表上工作,但它设法很好地调试了我的小型测试应用程序和真实应用程序,这比我在 eclipse 上所能说的要多那一刻,尽管这可能是我的错。
我可能应该早点发布这个:/这是我的 phpinfo() xdebug 部分
xdebug
xdebug support enabled
Version 2.1.0
Supported protocols Revision
DBGp - Common DeBuGger Protocol $Revision: 1.145 $
Directive Local Value Master Value
xdebug.auto_trace Off Off
xdebug.collect_assignments Off Off
xdebug.collect_includes On On
xdebug.collect_params 0 0
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.default_enable On On
xdebug.dump.COOKIE no value no value
xdebug.dump.ENV no value no value
xdebug.dump.FILES no value no value
xdebug.dump.GET no value no value
xdebug.dump.POST no value no value
xdebug.dump.REQUEST no value no value
xdebug.dump.SERVER no value no value
xdebug.dump.SESSION no value no value
xdebug.dump_globals On On
xdebug.dump_once On On
xdebug.dump_undefined Off Off
xdebug.extended_info On On
xdebug.file_link_format no value no value
xdebug.idekey no value no value
xdebug.manual_url http://www.php.net http://www.php.net
xdebug.max_nesting_level 100 100
xdebug.overload_var_dump On On
xdebug.profiler_aggregate Off Off
xdebug.profiler_append Off Off
xdebug.profiler_enable Off Off
xdebug.profiler_enable_trigger Off Off
xdebug.profiler_output_dir C:\xampp\tmp C:\xampp\tmp
xdebug.profiler_output_name xdebug_profile.%p xdebug_profile.%p
xdebug.remote_autostart Off Off
xdebug.remote_connect_back Off Off
xdebug.remote_cookie_expire_time 3600 3600
xdebug.remote_enable On On
xdebug.remote_handler dbgp dbgp
xdebug.remote_host localhost localhost
xdebug.remote_log c:\xampp\apache\logs\xdebug.log c:\xampp\apache\logs\xdebug.log
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
xdebug.scream Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars Off Off
xdebug.show_mem_delta Off Off
xdebug.trace_format 0 0
xdebug.trace_options 0 0
xdebug.trace_output_dir C:\xampp\tmp C:\xampp\tmp
xdebug.trace_output_name trace.%c trace.%c
xdebug.var_displ
ay_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 3 3
这是我的 xdebug 日志文件 重现问题
Log opened at 2011-01-03 08:56:22 -> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/xampp/htdocs/lab/zf-tutorial/public/index.php" language="PHP" protocol_version="1.0" appid="4404" idekey="ECLIPSE_DBGP"><engine version="2.1.0"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2010 by Derick Rethans]]></copyright></init> <- feature_set -i 33 -n show_hidden -v 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="33" feature="show_hidden" success="1"></response> <- feature_set -i 34 -n max_depth -v 3 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="34" feature="max_depth" success="1"></response> <- feature_set -i 35 -n max_children -v 31 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_set" transaction_id="35" feature="max_children" success="1"></response> <- feature_get -i 36 -n encoding -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="36" feature_name="encoding" supported="1"><![CDATA[iso-8859-1]]></response> <- feature_get -i 37 -n supports_async -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="feature_get" transaction_id="37" feature_name="supports_async" supported="1"><![CDATA[0]]></response> <- stdout -i 38 -c 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stdout" transaction_id="38" success="1"></response> <- stderr -i 39 -c 1 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stderr" transaction_id="39" success="0"></response> <- breakpoint_set -i 40 -t line -f file:///C:%5Cxampp%5Chtdocs%5Clab%5Czf-tutorial%5Cpublic%5Cindex.php -n 21 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="40" id="44040001"></response> <- run -i 41 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="41" status="break" reason="ok"><xdebug:message filename="file:///C:/xampp/htdocs/lab/zf-tutorial/public/index.php" lineno="21"></xdebug:message></response> <- stack_get -i 42 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="42"><stack where="{main}" level="0" type="file" filename="file:///C:/xampp/htdocs/lab/zf-tutorial/public/index.php" lineno="21"></stack></response> <- stack_get -i 43 -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="stack_get" transaction_id="43"><stack where="{main}" level="0" type="file" filename="file:///C:/xampp/htdocs/lab/zf-tutorial/public/index.php" lineno="21"></stack></response> <- eval -i 44 -- JHRoaXMtPmZpZWxkc1snYm9vbF9jb21wbGV0ZSdd -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="44"><property address="92404284" type="bool"><![CDATA[-1]]></property></response> <- eval -i 45 -- JHRoaXMtPnN0YWdlLT5nZXQoJ2Jvb2xfY29tcGxldGUnKQ== -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="45"><property address="92404284" type="bool"><![CDATA[-1]]></property></response> <- eval -i 46 -- JHRoaXMtPmZpZWxkc1snYm9vbF9jb21wbGV0ZSdd -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="46"><property address="92404284" type="bool"><![CDATA[-1]]></property></response> <- eval -i 47 -- JHRoaXMtPnN0YWdlLT5nZXQoJ2Jvb2xfY29tcGxldGUnKQ== -> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="eval" transaction_id="47"><property address="92404284" type="bool"><![CDATA[-1]]></property></response> === breakpoint reached, execution pauses. In eclipse I click "step over" <- step_over -i 48 === end of log
最佳答案
This article听起来很有希望。
从外观上看,XDebug 和 Eclipse(在其 php 开发环境中)都可以使用 DBGp 协议(protocol)。根据那篇文章,您可能可以通过弄乱 Apache 的 .htaccess 文件 [s] 或通过运行 DBGp 代理(无论是什么)来让事情正常进行。文章中有更多详细信息。
我怀疑 XDebug 和 Eclipse 都连接到同一个 PHP 调试 session ,踩到彼此的脚趾,导致欢闹接踵而至。
那个或“未定义的行为”。无论哪种方式。
关于php - 于是 eclipse 和 xdebug 走进了一个酒吧,然后我的 apache 服务器就死了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4509245/
我想安装一个带有一些身份验证的私有(private)Rubygem服务器。我希望能够使用公共(public)Ubuntu服务器托管内部gem。我读到了http://docs.rubygems.org/read/chapter/18.但是那个没有身份验证-如我所见。然后我读到了https://github.com/cwninja/geminabox.但是当我使用基本身份验证(他们在他们的Wiki中有)时,它会提示从我的服务器获取源。所以。如何制作带有身份验证的私有(private)Rubygem服务器?这是不可能的吗?谢谢。编辑:Geminabox问题。我尝试“捆绑”以安装新的gem..
使用带有Rails插件的vim,您可以创建一个迁移文件,然后一次性打开该文件吗?textmate也可以这样吗? 最佳答案 你可以使用rails.vim然后做类似的事情::Rgeneratemigratonadd_foo_to_bar插件将打开迁移生成的文件,这正是您想要的。我不能代表textmate。 关于ruby-使用VimRails,您可以创建一个新的迁移文件并一次性打开它吗?,我们在StackOverflow上找到一个类似的问题: https://sta
我需要从一个View访问多个模型。以前,我的links_controller仅用于提供以不同方式排序的链接资源。现在我想包括一个部分(我假设)显示按分数排序的顶级用户(@users=User.all.sort_by(&:score))我知道我可以将此代码插入每个链接操作并从View访问它,但这似乎不是“ruby方式”,我将需要在不久的将来访问更多模型。这可能会变得很脏,是否有针对这种情况的任何技术?注意事项:我认为我的应用程序正朝着单一格式和动态页面内容的方向发展,本质上是一个典型的网络应用程序。我知道before_filter但考虑到我希望应用程序进入的方向,这似乎很麻烦。最终从任何
我想要做的是有2个不同的Controller,client和test_client。客户端Controller已经构建,我想创建一个test_clientController,我可以使用它来玩弄客户端的UI并根据需要进行调整。我主要是想绕过我在客户端中内置的验证及其对加载数据的管理Controller的依赖。所以我希望test_clientController加载示例数据集,然后呈现客户端Controller的索引View,以便我可以调整客户端UI。就是这样。我在test_clients索引方法中试过这个:classTestClientdefindexrender:template=>
如果您尝试在Ruby中的nil对象上调用方法,则会出现NoMethodError异常并显示消息:"undefinedmethod‘...’fornil:NilClass"然而,有一个tryRails中的方法,如果它被发送到一个nil对象,它只返回nil:require'rubygems'require'active_support/all'nil.try(:nonexisting_method)#noNoMethodErrorexceptionanymore那么try如何在内部工作以防止该异常? 最佳答案 像Ruby中的所有其他对象
关闭。这个问题需要detailsorclarity.它目前不接受答案。想改进这个问题吗?通过editingthispost添加细节并澄清问题.关闭8年前。Improvethisquestion为什么SecureRandom.uuid创建一个唯一的字符串?SecureRandom.uuid#=>"35cb4e30-54e1-49f9-b5ce-4134799eb2c0"SecureRandom.uuid方法创建的字符串从不重复?
最近,当我启动我的Rails服务器时,我收到了一长串警告。虽然它不影响我的应用程序,但我想知道如何解决这些警告。我的估计是imagemagick以某种方式被调用了两次?当我在警告前后检查我的git日志时。我想知道如何解决这个问题。-bcrypt-ruby(3.1.2)-better_errors(1.0.1)+bcrypt(3.1.7)+bcrypt-ruby(3.1.5)-bcrypt(>=3.1.3)+better_errors(1.1.0)bcrypt和imagemagick有关系吗?/Users/rbchris/.rbenv/versions/2.0.0-p247/lib/ru
在Rails4.0.2中,我使用s3_direct_upload和aws-sdkgems直接为s3存储桶上传文件。在开发环境中它工作正常,但在生产环境中它会抛出如下错误,ActionView::Template::Error(noimplicitconversionofnilintoString)在View中,create_cv_url,:id=>"s3_uploader",:key=>"cv_uploads/{unique_id}/${filename}",:key_starts_with=>"cv_uploads/",:callback_param=>"cv[direct_uplo
我有一个正在构建的应用程序,我需要一个模型来创建另一个模型的实例。我希望每辆车都有4个轮胎。汽车模型classCar轮胎模型classTire但是,在make_tires内部有一个错误,如果我为Tire尝试它,则没有用于创建或新建的activerecord方法。当我检查轮胎时,它没有这些方法。我该如何补救?错误是这样的:未定义的方法'create'forActiveRecord::AttributeMethods::Serialization::Tire::Module我测试了两个环境:测试和开发,它们都因相同的错误而失败。 最佳答案
我想在Ruby中创建一个用于开发目的的极其简单的Web服务器(不,不想使用现成的解决方案)。代码如下:#!/usr/bin/rubyrequire'socket'server=TCPServer.new('127.0.0.1',8080)whileconnection=server.acceptheaders=[]length=0whileline=connection.getsheaders想法是从命令行运行这个脚本,提供另一个脚本,它将在其标准输入上获取请求,并在其标准输出上返回完整的响应。到目前为止一切顺利,但事实证明这真的很脆弱,因为它在第二个请求上中断并出现错误:/usr/b