• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

检查xdebug是否正常

用户头像
it1352
帮助1

问题说明

如果不安装texteditor或IDE,是否可以测试xdebug是否正常工作,即它是否可以调试php代码?

Without installing a texteditor or an IDE, is it possible to test if xdebug is working, i.e. if it can debug php code?

xdebug出现在phpinfo()中的唯一部分如下:

The only part xdebug comes up in phpinfo() is the following:

已解析/etc/php5/apache2/conf.d/mysql.ini的其他.ini文件, /etc/php5/apache2/conf.d/mysqli.ini、/etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini, /etc/php5/apache2/conf.d/xdebug.ini

Additional .ini files parsed /etc/php5/apache2/conf.d/mysql.ini, /etc/php5/apache2/conf.d/mysqli.ini, /etc/php5/apache2/conf.d/pdo.ini, /etc/php5/apache2/conf.d/pdo_mysql.ini, /etc/php5/apache2/conf.d/xdebug.ini

在phpinfo()中没有其他地方提到它.

It is not mentioned in the phpinfo() anywhere else.

正确答案

#1

如果没有实际进行调试,我想您可能不确定调试器正在工作.

Without actually doing some debugging, I guess you can't be certain that a debugger is working.

但是您可以肯定地说-我猜应该假设如果xDebug的某些方面正常工作,那么一切都会正常工作.

But you can be pretty sure -- I guess one should assume that if some aspects of xDebug are working then it would all be working.

鉴于此,您可以通过尝试以下操作来确认xDebug已安装并就位:

Given that, you can confirm that xDebug is installed and in place by trying the following:

1)phpinfo()-这将向您显示所有已加载的扩展,包括xDebug.如果它在那里,那么可以肯定它正在工作.

1) phpinfo() -- this will show you all the extensions that are loaded, including xDebug. If it is there, then it's a safe bet that it's working.

2)如果这对您还不够好,您可以尝试使用var_dump()功能. xDebug修改var_dump()的输出以包含其他信息.如果已安装,则xDebug可以正常工作.

2) If that isn't good enough for you, you can try using the var_dump() function. xDebug modifies the output of var_dump() to include additional information. If this is in place, then xDebug is working.

3)xDebug修改PHP的错误输出.如果您的程序在安装了xDebug的情况下崩溃,那么与标准的PHP崩溃输出相比,您将获得更多有关失败的信息.

3) xDebug modifies PHP's error output. If your program crashes with xDebug in place, you'll get more information about the failure than with the standard PHP crash output.

4)xDebug还向PHP添加了许多辅助函数.您可以尝试这些方法中的任何一种,以查看其是否有效.例如,函数xdebug_get_code_coverage()应该存在并返回一个数组.如果已安装,则将安装xDebug.如果不是,则不是.

4) xDebug also adds a number of helper functions to PHP. You could try any of these to see if it's working. For example, the function xdebug_get_code_coverage() should exist and return an array. If it does, then xDebug is installed. If not, it isn't.

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhcgabcg
系列文章
更多 icon
同类精品
更多 icon
继续加载