【问题标题】:Debugging PHP files on browser with Eclipse and xDebug使用 Eclipse 和 xDebug 在浏览器上调试 PHP 文件
【发布时间】:2011-07-29 06:48:36
【问题描述】:

我一直在网上阅读有关在 Eclipse 和 xDebug 上使用 PHP 为开发人员进行调试的信息。 我已经为 xDebug 安装了所有必需的文件,现在当我在 Eclipse 中时,我可以使用脚本运行调试器,它工作得很好。

问题是我在我的 Windows 机器上使用 AppServ(Apache、PHP 和 MySQL),当我在浏览器中加载 PHP 页面时,我想做的是在 Eclipse 中调试我的 PHP 文件(而不是在 Eclipse 中将它们作为脚本运行)。

这可能吗?

乔尔

【问题讨论】:

    标签: eclipse xdebug


    【解决方案1】:

    在 Oodles Technologies,我们广泛使用 PHP,希望这个答案对您有所帮助。

    打开 php.ini 文件后,添加以下行:

    注意:(php.ini 文件包含在 apache 和 php 两个文件夹中,建议配置存在于 apache 文件夹中的文件)

    <span style="font-size:16px;"><span style="font-family:arial,helvetica,sans-serif;">zend_extension = "c:/wamp/bin/php/php5.4.3/zend_ext/php_xdebug-2.2.0-5.4-vc9.dll"(use zend_extension_ts as variable name if you are using php version below 5.3)
    xdebug.remote_enable = 1
    xdebug.profiler_enable = 1
    xdebug.profiler_enable_trigger = 1
    xdebug.profiler_output_name = cachegrind.out.%t.%p
    xdebug.profiler_output_dir = "c:/wamp/tmp"
    </span></span>
    

    在此之后,确保文件系统中存在“c:/wamp/tmp”,如果不存在则创建该目录。

    然后重新启动您的 apache 服务。

    最后,打开您的 NetBeans 或 eclipse IDE 并在设置中配置 xdebug。

    希望对你有用。

    【讨论】:

      【解决方案2】:

      在 Eclipse 中,依次转到“首选项”、“PHP”、“调试”、“已安装的调试器”、“XDebug”、“配置”

      对于“接受远程会话”,将其更改为“本地主机”

      这将告诉 Eclipse 中的 XDebug 在任何人连接到 xdebug cookie 或 URL 参数集时进行调试 - 将其与 Easy XdebugxDebug Helper 一起使用,然后从现实的浏览器内上下文中进行调试变得轻而易举。

      我假设你有 Eclipse PDT,我不确定其他步骤是否不同。

      【讨论】:

        【解决方案3】:

        我不确定这是否是你要求的,但你可以看看并决定。

        使用 Firefox 轻松进行 Xdebug https://addons.mozilla.org/en-US/firefox/addon/easy-xdebug/

        【讨论】:

          猜你喜欢
          • 2013-03-13
          • 2015-12-04
          • 1970-01-01
          • 2020-03-28
          • 2023-03-08
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-12-09
          相关资源
          最近更新 更多