Scene
Os:mac OSX 10.10
Environment: MAMP PRO 3.03
php:5.5.10
Webgrind 1.1
Target:
1. Installing the Xdebug module for PHP
2. To view the data generated by the Xdebug, install Webgrind (a Web page that invokes the data).
3.webgrind role: Webgrind is a web-based performance analysis tool, its main role is to analyze the xdebug generated cachegrind files, in a user-friendly and detailed way to display performance data
Think:
1. Installing the Xdebug physical module into PHP
2. Configure xdebug,[in PHP to make the physical module action, equivalent to the driver.
3. Call the Xdebug captured file. [implemented by installing Webgrind]
Step
1.MAMP comes with xdebug.so module, no download required. [File path:/applications/mamp/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so]
Check: Manually find the corresponding file.
2. Configure Xdebug.
With Mamp PRO selected, select File>>edit template>>php>>php5.5.10.ini in the menu bar
Add two lines of code in the last [Xdebug]: (path modified as needed)
[xdebug]zend_extension= "/applications/mamp/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212/ xdebug.so "xdebug.profiler_enable = 1xdebug.profiler_output_dir ="/tmp "
Detection: Open Mamppro Web version view Phpinfo[http://localhost/mamp/index.php?language=english&page=phpinfo]
The Xdebug module shows that the first two steps are correct.
3. Execute the PHP file on the Web page, and then view the/tmp file in the folder to see if there are any files [cachegrind.out.xxx] generated. There is a description xdebug normal operation. Next, it's about how to read these files.
Command+shift+g open "Go to Folder", Output/TMP [This path is consistent with the configuration path in Step2]
4. Read Xdebug production file [cachegrind.out.xxx] There are many ways to write this article webgrind.
Webgrind principle: is a normal page [has collection function]. Can be directly to the website root directory [location with personal preferences]
Implementation steps: Download >> deployment >> use
:Https://github.com/jokkedk/webgrind
Use: Refer to Reference Document 2
Reference documents
1:how to run Xdebug on Mac OSX using MAMP
2:webgrind installation using detailed instructions
How to install Xdebug,webgrind under Mamp?