Home Backend Development PHP Tutorial ChromePHP for PHP debugging

ChromePHP for PHP debugging

Sep 05, 2019 pm 01:47 PM
php debugging

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

10 debugging tips for PHP development 10 debugging tips for PHP development May 24, 2023 am 08:23 AM

In the PHP development process, debugging is an inevitable process. However, when some developers encounter problems, they often use very inefficient methods to debug, such as break points, output debugging information, etc. These methods may not be able to effectively solve the problem, and will also waste a lot of time and energy. To this end, this article will introduce 10 efficient debugging skills in PHP development. I believe these skills can help PHP developers solve problems faster and more accurately. Use xdebugxdebug is a powerful tool in the PHP debugging process

PHP Linux Script Debugging Tips: Ways to Solve Common Problems PHP Linux Script Debugging Tips: Ways to Solve Common Problems Oct 05, 2023 am 10:07 AM

PHPLinux script debugging skills: methods to solve common problems, specific code examples are required Introduction: When developing and maintaining PHP scripts, we often encounter various problems. Debugging is one of the key steps in resolving these issues. This article will introduce some common problems and solutions for debugging PHP scripts in a Linux environment, and provide specific code examples. 1. Use echo and var_dump to output variable values. When debugging PHP scripts, we often need to view the values ​​of variables to determine the execution of the code.

PHP debugging tips: How to use the xdebug plug-in for code debugging and breakpoint setting PHP debugging tips: How to use the xdebug plug-in for code debugging and breakpoint setting Aug 01, 2023 pm 07:57 PM

PHP debugging tips: How to use the xdebug plug-in for code debugging and breakpoint setting Introduction: Debugging is a very important link when developing PHP applications. Debugging can help us quickly find errors in the code and fix them, improving development efficiency. xdebug is one of the debugging plug-ins commonly used by PHP developers. It provides powerful debugging functions. This article will introduce how to use the xdebug plug-in for code debugging and breakpoint setting. 1. To install and configure the xdebug plug-in, use the xdebug plug-in.

Detailed explanation of debugging skills in PHP language development Detailed explanation of debugging skills in PHP language development Jun 09, 2023 pm 07:37 PM

In PHP language development, debugging skills are a very important part. Debugging is an essential process in development, which can help us find defects and errors in the program. In this article, we will explain in detail the debugging skills in PHP language development to help developers develop more efficiently. Using the var_dump() and print_r() functions In the PHP language, the var_dump() and print_r() functions are one of the most commonly used debugging tools. Both of these functions can help us type on the web page

Debugging the problem of unable to locate the wrong code in PHP Debugging the problem of unable to locate the wrong code in PHP May 11, 2023 pm 07:01 PM

As an open source, general-purpose scripting language, PHP is widely used in the field of web development. In daily development work, we will inevitably encounter the problem of being unable to locate error codes. This article will introduce the problem of unable to locate the error code in debugging in PHP, and provide some practical debugging skills and tools. 1. Code review When encountering code problems, first check whether the code has grammatical or logical errors. PHP provides error_reporting and display_errors directives to capture and display error information.

How to quickly debug WeChat applet interface with PHP How to quickly debug WeChat applet interface with PHP Jun 02, 2023 am 08:10 AM

In recent years, the popularity of WeChat mini programs has continued to rise, and more and more developers have begun to get involved. For PHP developers, how to quickly debug the WeChat applet interface is a necessary skill. This article will introduce you to the methods and steps on how to quickly debug the WeChat applet interface in PHP. 1. Turn on the debugging mode. First, you need to turn on the debugging mode in the WeChat applet. In the left sidebar of the WeChat Mini Program Development Tool, click "Settings" - "Project Settings" and check the "Debug Mode in Developer Tools" option. open

Getting Started with PHP: PHP Debugging Getting Started with PHP: PHP Debugging May 22, 2023 pm 10:51 PM

PHP is a popular programming language that is widely used in both website development and desktop application development. If you are learning PHP, then you should know that debugging is an important part of writing code. In PHP programs, you may encounter various problems, such as slow program operation, invalid calls, poor server response, etc. Debugging is about finding these problems and solving them. In this article, we will introduce some basic concepts, methods and tools for PHP debugging to help you better

How to debug interactive command line of PHP functions with PsySH? How to debug interactive command line of PHP functions with PsySH? Apr 23, 2024 pm 03:36 PM

PsySH provides an interactive PHP debugging command line interface to test your code in real time without setting breakpoints or modifying the code. Its usage includes: Install PsySH: composerglobalrequirepsy/psysh Start PsySH: psysh Define the function to be debugged: $multiply=function($a,$b){return$a*$b;} Call the function: multiply(2,3) Use autocomplete to view function signatures and information

See all articles