ChromePHP for PHP debugging

藏色散人
Release: 2023-04-07 11:40:01
forward
3695 people have browsed it

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

ChromePHP

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

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

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

PHP

ChromePHP 下载 chrome_php.php .

代码使用

<?php<br/>    return &#39;chrome_php.php&#39;;<br/>    ChromePhp::log(&#39;this is php log&#39;);<br/>   <br/>    ChromePhp::info($_SERVER);<br/>   <br/>    //ChromePhp::log(23,&#39;info&#39;);<br/>    //ChromePhp::error(&#39;some info&#39;)<br/>compose.json 使用<br/>{<br/>    "autoload": {<br/>        "psr-4": {<br/>            "bookLog\\": "bookLog"<br/>        },<br/>        "files": [<br/>           "comFunction/chrome_php.php" #对应要加载的文件地址<br/>        ]<br/>    }<br/>   <br/>}<br/>
Copy after login

浏览器

ChromePHP for PHP debugging

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

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

The above is the detailed content of ChromePHP for PHP debugging. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template