Xdebug Performance Analysis of PHP program

Source: Internet
Author: User

Here is only the Xdebug performance optimization (Xdebug can also be combined with other IDE breakpoint debugging, etc.), the detailed can refer to Xdebug's official site http://xdebug.org/

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. (http://baike.baidu.com/view/1823486.htm)

Installation of Xdebug

PHP's integrated development environment Wampserver and XAMPP have been installed Xdebug, but may not be open, need to open to the php.ini, through the phpinfo can be learned whether the installation of Xdebug extensions;

Native PHP Environment (Win32 or Linux) how to install Xdebug,baidu or Google

Xdebug How to track performance

1 using Xdebug API xdebug_time_index () , specific reference http://xdebug.org/docs/basic

2 generate files, through tools to analyze, specific reference Http://xdebug.org/docs/profiler

There are two ways to generate files:

A a file is generated each time the program executes

b Generate files according to the Get/post/cookie parameter

Example: http://localhost/index.php? Xdebug_profile, note that you must capitalize here .

Cookie mode Firebug and chrome have plugins

Using this method, you need to set Xdebug.profiler_enable to 0 and turn on Xdebug.profiler_enable_trigger

Tools

Webgrind This is a browser-based PHP program, need to analyze the file is not many cases, can be very convenient to use

Wincachegrind Win32 Platform

Kcachegrindtool (Linux/windows, KDE)

My partial xdebug parameter (there are no write properties that have default values)

Zend_extension = "D:\xampp\php\ext\php_xdebug.dll"
Xdebug.profiler_append = On
Xdebug.profiler_enable = Off
Xdebug.profiler_enable_trigger = On
Xdebug.profiler_output_dir = "D:\xampp\tmp"
Xdebug.profiler_output_name = "cachegrind.out.-%s"

Xdebug Performance Analysis of PHP program

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.