PHP调试之ChromePHP

栏目: PHP · 发布时间: 4年前

内容简介:PHP调试工具有很多,这里只介绍ChromePHPChromePhp 是 基于谷歌浏览器的插件 .在PHP代码中,不会终止代码,并且会在谷歌 console 台中打印出信息 .

PHP调试 工具 有很多,这里只介绍ChromePHP

ChromePHP

ChromePhp 是 基于谷歌浏览器的插件 .

PHP 代码中,不会终止代码,并且会在谷歌 console 台中打印出信息 .

插件链接 下载 chrome_php_logger.crx 并且安装 .

PHP

ChromePHP 下载 chrome_php.php .

代码使用

<?php
    return 'chrome_php.php';

    ChromePhp::log('this is php log');
   
    ChromePhp::info($_SERVER);
   
    //ChromePhp::log(23,'info');
    //ChromePhp::error('some info')

compose.json 使用

{
    "autoload": {
        "psr-4": {
            "bookLog\\": "bookLog"
        },
        "files": [
           "comFunction/chrome_php.php" #对应要加载的文件地址
        ]
    }
   
}

浏览器

PHP调试之ChromePHP

通过浏览器访问,在 console 台中可以看到 PHP 中想要的打印信息已经输出!

Tips : 不同浏览器的版本, console 台中的数据可能单次不会出现 . 在访问地址时,关闭 console 台, 访问结束后开启 console(F12) 台,这样就会有信息输出了!


以上所述就是小编给大家介绍的《PHP调试之ChromePHP》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

The Nature of Code

The Nature of Code

Daniel Shiffman / The Nature of Code / 2012-12-13 / GBP 19.95

How can we capture the unpredictable evolutionary and emergent properties of nature in software? How can understanding the mathematical principles behind our physical world help us to create digital w......一起来看看 《The Nature of Code》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

html转js在线工具
html转js在线工具

html转js在线工具