检查xdebug是否正常
问题说明
如果不安装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.
正确答案
如果没有实际进行调试,我想您可能不确定调试器正在工作.
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
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20