Using Xdebug to debug and optimize PHP programs [1]_php Tutorial

Source: Internet
Author: User
Author: Haohappy Msn:haohappy at MSN.com blog:http://blog.csdn.net/haohappy2004 2006-07-04 Why do I need Debugger?Many PHP programmers debug using Echo, Print_r (), Var_dump (), printf () and so on, in fact, for developers with a richer development experience these are enough, they can often in the process of program execution, By outputting the value of a particular variable, you can tell whether the program is executing correctly, or even how efficient it may be (some time functions, of course). So why do we need a dedicated debug program to monitor our program's operation? The answer to this question may be left behind to reveal. What is Xdebug?Xdebug is an open source PHP program debugger (a debug tool) that can be used to track, debug, and analyze the health of PHP programs. Xdebug is now the latest version of Xdebug 2.0.0BETA6, which supports PHP4/PHP5. Official site: www.Xdebug.org How to install Xdebug ? Take Php5.1.4,windows platform as an example (other PHP version, other platforms please refer to official documents): 1. Login www.xdebug.org, on the right side of the home page has a Windows modules, select the 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 it to 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 "after the directory" I:\Projects\xdebug "for the data file you want to put Xdebug output directory, can be set freely. 4. Restart Apache;5. Write a test.php with the contents of If you see Xdebug in the output content, the installation configuration is successful. now we can start using Xdebug Powerful features!

http://www.bkjia.com/PHPjc/318377.html www.bkjia.com true http://www.bkjia.com/PHPjc/318377.html techarticle Author: haohappy msn:haohappy at msn.com blog:http://blog.csdn.net/haohappy2004 2006-07-04 Why do I need Debugger? Many PHP programmers debug using Echo, Print_r (), Var_dump () 、...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.