Use Xdebug to debug and optimize PHP programs [1]. Author: HaohappyMSN: haohappyatmsn. comBlog: blog. csdn. nethaohappy20042006-07-04 why need Debugger? Many PHP programmers use echo, print_r (), var_dump (),
Author:
Haohappy
MSN: haohappy at msn.com
Blog: http://blog.csdn.net/haohappy2004
2006-07-04
Why?
Debugger?Many PHP programmers use echo, print_r (), var_dump (), and printf () for debugging. In fact, this 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 PHP program debugger (a Debug tool) that 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:
If xdebug is displayed in the output, the installation and configuration are successful.
Now we can start using
Xdebug
Powerful functions!
Export Haohappy MSN: haohappy at msn.com Blog: http://blog.csdn.net/haohappy2004 2006-07-04 why do you need Debugger? Many PHP programmers use echo, print_r (), var_dump (),...