xdebug, kcachegrind and webgrind with wampserver
DESCRIPTION
How to use KCacheGrind and Webgrindwith Xdebug PHP extension works on WampServerTRANSCRIPT
Xdebug, KCacheGrind and Webgrindwith WampServer
Michał SzkodzińskiIT Manager
Mediovski Technology11 July 2010Warsaw, Poland
Summary
Summary
This presentation showshow to use KCacheGrind and Webgrind
with Xdebug PHP extension works on WampServer.
You need WampServer, base knowledge about profiling PHP applications,internet connection and 15 minutes of free time.
You can find all usefull web addresses on the last slide.
3/21
Agenda
1. Xdebug extension for PHP
2. KCacheGrind for Windows
3. Webgrind
4. Connect KCacheGrind and Webgrind with WampServer
4/21
1. Install Xdebug
1. Download Xdebug binaries for Windows from:http://www.xdebug.org/download.php
Xdebug
2. Save dll file to your PHP extensions directory, for exampleC:\wamp\bin\php\php5.3.1\ext
3. Rename dll file to php_xdebug.dll
Choose file for your PHP and Windows version - I get '5.3 VC6 (32 bit)'
6/21
extension=php_xdebug.dll
zend_extension = c:\wamp\bin\php\php5.3.1\ext\php_xdebug.dllxdebug.remote_enable=1xdebug.remote_host="127.0.0.1"xdebug.remote_port=9000xdebug.remote_handler="dbgp"xdebug.remote_mode=reqxdebug.profiler_enable=1xdebug.profiler_output_dir="c:/wamp/tmp/"xdebug.collect_params=Onxdebug.show_local_vars=On
4. Add new line in Your php.ini file:
Xdebug 7/21
Check if paths are correct for your WampServer configuration.
2. Install KCacheGrind
1. Download and run The KDE on Windows installerfrom The KDE on Windows Project website
http://www.winkde.org/pub/kde/ports/win32/installer/kdewin-installer-gui-latest.exe
KCacheGrind 9/21
2. Type path to installation directory, for example C:\Program Files\KDE
3. Choose kcachegrind from list of packages
KCacheGrind 10/21
4. You can find KCacheGrind in KDE bin directory,for example C:\Program Files\kde\bin
KCacheGrind 11/21
3. Install Webgrind
1. Download zip archive from http://code.google.com/p/webgrind/downloads/list
2. Extract to your root www directory, for exampleC:\wamp\www\webgrind
3. You can find it on http://localhost/webgrind
Webgrind 13/21
4. Connect with WampServer
2. Add three new lines in [Menu.Left] section:
Type: item; Caption: "KCacheGrind"; Action: run; FileName:"C:\Program Files\kde\bin\kcachegrind.exe"; Parameters: ""; Glyph: 5
Type: item; Caption: "Webgrind"; Action: run; FileName: "${c_navigator}";Parameters: "http://localhost/webgrind/"; Glyph: 5
Type: separator; Caption: ""
1. Edit your WampServer template file C:\wamp\wampmanager.tpl
WampServer 15/21
Check if file names are correct.
3. Restart WampServer
4. Now You can launch KCacheGrind and Webgrind from WampServer menu
WampServer 16/21
5. Use it to improve performance of Your PHP based application
5. Use new features
KCacheGrind 18/21
Choose cachegrind file See calers and callee mapSwitch to relative view
Search and group function
Webgrind 19/21
Choose cachegrind file Sort by type of function, count or cost
Open file
See calls and called from
Web addresses
Usefull web addresses:
• WampServer– http://www.wampserver.com/en – homepage– http://www.wampserver.com/dl.php – download
• Xdebug– http://www.xdebug.org – product homepage– http://www.xdebug.org/download.php – download
• KCacheGrind– http://kcachegrind.sourceforge.net/html/Home.html – product homepage
• The KDE on Windows Project– http://windows.kde.org – project homepage– http://www.winkde.org/pub/kde/ports/win32/installer/kdewin-installer-gui-latest.exe – installer
• Webgrind– http://code.google.com/p/webgrind – project homepage– http://code.google.com/p/webgrind/downloads/detail?name=webgrind-release-1.0.zip – download
20/21
Questions 21/21
Questions? Contact us!
Mediovski Technology
ul. Wita Stwosza 4002-661 Warsaw, Poland
phone: +48 22 646 76 84e-mail: [email protected]: http://technology.mediovski.pl
Join us: