Blog: http://blog.csdn.net/haohappy2004
Many PHP programmers debug using Echo, Print_r (), Var_dump (), printf (), and so on, but for programmers with richer development experience, they can often By outputting the value of a particular variable, you can tell whether the program is performing correctly, or even how efficient it can be (some time functions may be required, of course). So why do we need a special debugging program to monitor our program's operation? The answer to this question may well be left behind to reveal.
Xdebug is an open source PHP debugger (a debug tool) that you can use to track, debug, and analyze the state of your PHP program. Xdebug's current version is Xdebug 2.0.0BETA6, which supports PHP4/PHP5.
Official site: www.Xdebug.org
Take the Php5.1.4,windows platform as an example (other PHP version, other platforms please refer to the official website documentation):
1. Login www.xdebug.org, on the right side of the home page has a Windows modules, select which php5.1.2+, download Php_xdebug-5.1.2-2.0.0beta6.dll file;
2. Place the downloaded Php_xdebug-5.1.2-2.0.0beta6.dll in the C:\php5\ext directory and rename to Php_xdebug.dll;
3. Edit PHP.ini and add the following lines:
Xdebug.profiler_enable=on
Xdebug.trace_output_dir= "I:\Projects\xdebug"
Xdebug.profiler_output_dir= "I:\Projects\xdebug"
The following directory "I:\Projects\xdebug" for the directory where you want to place the Xdebug output data file, can be set freely.
5. Write a test.php, the content is
<?php phpinfo ()?>, if you see xdebug in the content of the output, the installation configuration is successful.
now we can start using
Xdebug
powerful function of the!