search
Homephp教程PHP开发PHPLog php program debugging and tracking tool

1. During the execution of the program, record the variables you want to track, the call stack and the parameters of each function call in the corresponding places.
Record this information to the file in a certain format, one variable per line, specific data format Please refer to the code, I won’t go into details here.

2. Now you have all the information (including call stack and parameters) every time the variable is recorded. When you access this program through the browser, this program will read the entire file Analysis,
Display all your debugging information on the page, and it will dynamically refresh with ajax to keep synchronized with your debugging.

Draw a picture, it will be much clearer.


BackTrace is the call stack information. It is not reflected in the picture, it is dynamically refreshed by ajax.


Function:

A few more screenshots of the local machine will be explained:

1. Include files, debugging variables (the above is the program, the following is apache_request_headers() Debug output)

2. Call stack list of a certain function in the drupal system


3. Call parameters of a certain function in the stack


Postscript:


Program It basically implements the functions of debugging and tracking PHP variables, and also comes with the function of viewing call stacks and call parameters.

Nowadays, echo, print_r, var_dump and other system functions are rarely used for debugging output unless necessary. Basically, you can get what you want with this.

Especially for complex systems like drupal, you can clearly know how the program is executed.


Note:

The program is written in php4 , tested on php4.4.8, 5.2.5, and theoretically supports php4, php5.

It has also been tested on linux, window, ie6-7, and firefox, but I still can’t guarantee that it will not work in your environment. If there is an error, please correct it yourself.

Please do not let the log file exceed 5M in size, the browser may crash.

Thank you for reading. For more related articles, please pay attention to the PHP Chinese website (www.php.cn) !

Statement
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 Article

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool