PHP debugging tools Debug Tools_PHP tutorial
I found a good comrade who can debug PHP source code: PHP DEBUG TOOLS
Its project address: http://freshmeat.net/projects/php-debug-tools/
File download address: http:// freshmeat.net/urls/7c58ae3fecce5763e7546b958d36e082
It is currently version 1.03
The environment here is WINDOW XP, APACHE2.2, PHP5.2+ Zend Optimizer,
This is combined with PHP DEBUG TOOLS Help document to explain, some pictures are excerpted from the document.
1. Installation
Preparation environment before installation: X-Debug must be installed first,
As for how to install X-Debug, please see http://www.xdebug.org/docs/install
1. Download the appropriate X-DEBUG version from http://www.xdebug.org/download.php
2. Unzip the DLL file to the ext directory under the PHP installation directory, such as C:/php/ext/php_xdebug-2.0.4-5.2.8-nts.dll
3. Modify the php.ini file and add the following paragraph:
-- ----------I am the dividing line of perversion, you can't see me---------------------
zend_extension = "C:/php/ext/php_xdebug-2.0.4-5.2.8-nts.dll"
xdebug.collect_includes = Off
xdebug.default_enable = Off
xdebug.dump_globals = Off
xdebug.dump_once = Off
xdebug.extended_info = Off
-------------This is a perverted dividing line, you can’t see me------- ------------------
Note: This example is for non-thread safe version. For the thread safe version change "zend_extension" to "zend_extension_ts"
After the installation is complete, unzip all the files in the PHP DEBUG TOOLS compressed package to the website release directory.
(Assume the release directory is c:www, then create a new debug directory in it and throw all the files into it)
Enter in the browser: http://localhost/debug/test1-debug.php
If you see the picture below, the installation is successful.
2. Debugging
1.Debug errors
For example, the following code:
php
require './lib/debug.php';
function test($a, $b)
{
echo $asd;
}
test(10, ' abc');
?>

2. Use Debug() to debug
such as the following code:
require './lib/debug.php';
function test($args)
{
test_nested($args);
}
function test_nested($args)
{
debug($args);
// or: debug(get_defined_vars() );
// or: debug();
}
test(array('id'=>123, 'str'=>'test'));
?>

3. Use dump() or dump_tofile() to debug
such as the following code:
include_once './lib/dump.php';
function test5()
{
include './testdata/test0.php';
$test = array('int'=>1, 'float'=>2.0, 'float2'=>2.1);
dump($test, $_SERVER);
}
function test1() { test2(); }
function test2() { test3(); }
function test3() { test4() ; }
function test4() { test5(); }
test1();
?>

As for dump_tofile(), it is generally used in the following situations:
A. When you don’t want to stop the program running
B. It’s not that you don’t want to display the debugging data, but that you can’t. For example, when When you request status in AJAX.
C. You also want to debug in multiple places
Please refer to test7-dump_tofile.php in the debug directory
Note: I am running dump( ) or dump_tofile(), it is found that the

mentioned in the PHP DEBUG TOOL document does not appear. This can be corrected by modifying the code of debug/lib/debug.php. (Because dump_tofile() has been called dump(), so we only need to modify one place.
echo $pre at line 149;
is modified to:
//edit by benben--- start
echo '';
//edit by benben---end
Corrected picture:

4. Track the code, view System performance
You can browse test3-trace.php in the directory, and then click the console in the lower right corner.
For details, please refer to the documentation. (The documentation is in the doc directory in the compressed package)
3. How to integrate it with the project?
First, unzip the php debug tool file and place it in the project directory. Create a directory and call it debug! : )
Actually All we need is a few files.
For example, the path is: c:wwwprojectNamedebug
After that, we can debug in two ways
The first one is to add this sentence to the project source code :
include_once('./lib/debug.php');
For example: c:wwwprojectNamehellodebugindex.php
include_once('./debug/lib/debug.php');
$faint = 'helloworld ,debuging';
debug($arrb);
?>
What? You don’t want to write this sentence on every page?
Then look at the second one method,
There are two methods here,
1. Modify php.ini and add the following content (modify to your own directory):
auto_prepend_file = "c:wwwprojectNamedebugauto_prepend.php"
auto_append_file = "c:wwwprojectNamedebugauto_append.php"
2. Modify the .htaccess file (note: I have never tried this method, hehe)
php_value auto_prepend_file "c:wwwprojectNamedebugauto_prepend.php"
php_value auto_append_file "c :wwwprojectNamedebugauto_append.php"
This will facilitate the debugging of the entire project.
If it is AJAX development, there are still necessary places, please refer to the document for details. (Because I don’t have that yet. It’s necessary, so I’ll skip it for now and don’t make a fool of myself, hehe.)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

thinkphp6...

This article recommends ten well-known virtual currency-related APP recommendation websites, including Binance Academy, OKX Learn, CoinGecko, CryptoSlate, CoinDesk, Investopedia, CoinMarketCap, Huobi University, Coinbase Learn and CryptoCompare. These websites not only provide information such as virtual currency market data, price trend analysis, etc., but also provide rich learning resources, including basic blockchain knowledge, trading strategies, and tutorials and reviews of various trading platform APPs, helping users better understand and make use of them

Based on market data and common evaluation criteria, this article lists the top ten formal Web3 trading platform APPs in 2025. The list covers well-known platforms such as Binance, OKX, Gate.io, Huobi (now known as HTX), Crypto.com, Coinbase, Kraken, Gemini, BitMEX and Bybit. These platforms have their own advantages in user scale, transaction volume, security, compliance, product innovation, etc. For example, Binance is known for its huge user base and rich product services, while Coinbase focuses on security and compliance. Choosing a suitable platform requires comprehensive consideration based on your own needs and risk tolerance.

Digital currency rolling positions is an investment strategy that uses lending to amplify trading leverage to increase returns. This article explains the digital currency rolling process in detail, including key steps such as selecting trading platforms that support rolling (such as Binance, OKEx, gate.io, Huobi, Bybit, etc.), opening a leverage account, setting a leverage multiple, borrowing funds for trading, and real-time monitoring of the market and adjusting positions or adding margin to avoid liquidation. However, rolling position trading is extremely risky, and investors need to operate with caution and formulate complete risk management strategies. To learn more about digital currency rolling tips, please continue reading.

This article lists the top ten well-known Web3 trading platforms, including Binance, OKX, Gate.io, Kraken, Bybit, Coinbase, KuCoin, Bitget, Gemini and Bitstamp. The article compares the characteristics of each platform in detail, such as the number of currencies, trading types (spot, futures, options, NFT, etc.), handling fees, security, compliance, user groups, etc., aiming to help investors choose the most suitable trading platform. Whether it is high-frequency traders, contract trading enthusiasts, or investors who focus on compliance and security, they can find reference information from it.

This article provides detailed exchange recommendations and introductory tutorials for beginners in the currency circle. Commonly used exchanges such as Coinbase, Binance, Kraken, Ouyi and Sesame Open Door are recommended, and the steps for registration, identity verification, security settings, recharge and trading are introduced. The article also emphasizes the importance of security awareness, risk control and continuous learning, aiming to help beginners enter the digital asset field safely and rationally.

There are six free market viewing software websites: 1. Binance platform, suitable for digital asset investors; 2. OKX platform, providing rich market data; 3. Sesame Open Door (Gate.io) platform, suitable for users who trade in Gate.io; 4. TradingView, providing professional charting tools; 5. CoinMarketCap, covering a wide range of digital asset data; 6. CoinGecko, providing project fundamental evaluation. When choosing a platform, you need to consider investment objects, chart function requirements, data comprehensiveness and user experience.

This article recommends several commonly used and relatively safe virtual currency exchanges for beginners entering the currency circle in 2025, including Binance, Ouyi, Coinbase and Sesame Open Door. The article provides detailed tutorials on registration, authentication, security setup and transaction process, and emphasizes the importance of risk control, security awareness and ongoing learning, aiming to help beginners securely get started with digital asset trading.
