PHP登录本机控制台Firefox Developer [英] PHP Logs in native console Firefox Developer
问题描述
与firebug开发人员相比,我更喜欢firefox开发人员检查人员.
I highly prefer the firefox developer inspector than the firebug one.
但是可以在本机JS控制台中显示PHP日志吗?
But is that possible to display PHP logs in the native JS console ?
谢谢:)
推荐答案
我刚刚安装了Chrome Logger( github | 网站)和 https://developer.mozilla.org/zh-CN/docs/Tools/Web_Console/Console_messages#Server ).
I just installed Chrome Logger ( github | website ) with Chrome PHP to accomplish this in Chrome since Firefox 50+ broke FirePHP. I then learned that Firefox's web console has been supporting Chrome Logger since v43 (https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Console_messages#Server).
简而言之,是的,您可以使用Chrome PHP将PHP变量记录到Firefox Web控制台.就这么简单:
So in short, yes, you can log PHP variables to the Firefox web console using Chrome PHP. It's this simple:
- 下载最新的Chrome PHP库: > https://github.com/ccampbell/chromephp
- 将其包含在您的项目(
include 'ChromePhp.php';
) 中
- 在您的php脚本(
ChromePhp::log($_MyArray);
)中记录一些内容 - 打开Firefox Web控制台并打开服务器标签( https://developer.mozilla.org/zh-CN/docs/Tools/Web_Console/Console_messages#Filtering_by_category )
- Download the latest Chrome PHP library: https://github.com/ccampbell/chromephp
- Include it in your project (
include 'ChromePhp.php';
) - Log something in your php script (
ChromePhp::log($_MyArray);
) - Open Firefox web console and turn on the Server tab (https://developer.mozilla.org/en-US/docs/Tools/Web_Console/Console_messages#Filtering_by_category)
希望这会有所帮助.在发现较新版本支持此功能之前,我拖延了几年的Firefox升级.
Hope this helps. I procrastinated upgrading Firefox for a few years before discovering that newer versions had support for this.
这篇关于PHP登录本机控制台Firefox Developer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!