21
Xdebug, KCacheGrind and Webgrind with WampServer Michał Szkodziński IT Manager Mediovski Technology 11 July 2010 Warsaw, Poland

Xdebug, KCacheGrind and Webgrind with WampServer

Embed Size (px)

DESCRIPTION

How to use KCacheGrind and Webgrindwith Xdebug PHP extension works on WampServer

Citation preview

Page 1: Xdebug, KCacheGrind and Webgrind with WampServer

Xdebug, KCacheGrind and Webgrindwith WampServer

Michał SzkodzińskiIT Manager

Mediovski Technology11 July 2010Warsaw, Poland

Page 2: Xdebug, KCacheGrind and Webgrind with WampServer

Summary

Page 3: Xdebug, KCacheGrind and Webgrind with WampServer

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

Page 4: Xdebug, KCacheGrind and Webgrind with WampServer

Agenda

1. Xdebug extension for PHP

2. KCacheGrind for Windows

3. Webgrind

4. Connect KCacheGrind and Webgrind with WampServer

4/21

Page 5: Xdebug, KCacheGrind and Webgrind with WampServer

1. Install Xdebug

Page 6: Xdebug, KCacheGrind and Webgrind with WampServer

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

Page 7: Xdebug, KCacheGrind and Webgrind with WampServer

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.

Page 8: Xdebug, KCacheGrind and Webgrind with WampServer

2. Install KCacheGrind

Page 9: Xdebug, KCacheGrind and Webgrind with WampServer

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

Page 10: Xdebug, KCacheGrind and Webgrind with WampServer

2. Type path to installation directory, for example C:\Program Files\KDE

3. Choose kcachegrind from list of packages

KCacheGrind 10/21

Page 11: Xdebug, KCacheGrind and Webgrind with WampServer

4. You can find KCacheGrind in KDE bin directory,for example C:\Program Files\kde\bin

KCacheGrind 11/21

Page 12: Xdebug, KCacheGrind and Webgrind with WampServer

3. Install Webgrind

Page 13: Xdebug, KCacheGrind and Webgrind with WampServer

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

Page 14: Xdebug, KCacheGrind and Webgrind with WampServer

4. Connect with WampServer

Page 15: Xdebug, KCacheGrind and Webgrind 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.

Page 16: Xdebug, KCacheGrind and Webgrind with WampServer

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

Page 17: Xdebug, KCacheGrind and Webgrind with WampServer

5. Use new features

Page 18: Xdebug, KCacheGrind and Webgrind with WampServer

KCacheGrind 18/21

Choose cachegrind file See calers and callee mapSwitch to relative view

Search and group function

Page 19: Xdebug, KCacheGrind and Webgrind with WampServer

Webgrind 19/21

Choose cachegrind file Sort by type of function, count or cost

Open file

See calls and called from

Page 20: Xdebug, KCacheGrind and Webgrind with WampServer

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

Page 21: Xdebug, KCacheGrind and Webgrind with WampServer

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: