Author: Haohappy MSN: haohappy at msn.com Blog: http://blog.csdn.net/haohappy2004 2006-07-04 Why? Debugger? Many PHP
Program Debugging Using echo, print_r (), var_dump (), and printf () is enough for programmers with rich development experience, during program execution, they can output the values of specific variables to determine whether the program is correctly executed, even the efficiency can be seen (of course, some time functions may need to be used ). So why do we need a special debugging program to monitor our program running? The answer to this question may be later.
What is Xdebug? Xdebug is an open
Source code The PHP program debugger (a debug tool) can be used to track, debug, and analyze the running status of PHP programs. The latest version of xdebug is xdebug 2.0.0beta6 and supports PhP4/PhP5. Official site: www.xdebug.org
How to install Xdebug ? Take php5.1.4 and windows as an example (for other PHP versions, see the official website for other platforms): 1. log on to www.xdebug.org, there is a Windows modules on the right of the home page, select php5.1.2 +, download the php_xdebug-5.1.2-2.0.0beta6.dll file; 2. put the downloaded php_xdebug-5.1.2-2.0.0beta6.dll in the C: \ PhP5 \ ext directory and rename it php_xdebug.dll; 3. edit PHP. INI, add the following lines: Extension = php_xdebug.dll [xdebug] xdebug. profiler_enable = onxdebug. trace_output_dir = "I: \ projects \ xdebug" xdebug. profiler_output_dir = "I: \ projects \ xdebug" Ebug "you can set the directory of the data file output by xdebug as needed. 4. Restart Apache. 5. Write a test. php file with the following content:
<? PHP phpinfo ();?> If xdebug is displayed in the output, the installation and configuration are successful.
Now we can start using Xdebug Powerful functions!