开发者

webgrind on wamp

I just installed wamp and the latest vers开发者_运维知识库ion comes with webgrind, but i cannot figure out how it works.It says

Select a cachegrind file above

And thats all.


Webgrind is a parser/viewer for a profiling file format called cachegrind. The PHP extension Xdebug can (among other very useful things) generate these. For webgrind to work, Xdebug needs to be installed and enabled.

  1. Make sure Xdebug is installed and working (see the Xdebug docs for info on how to do that)
  2. Have Xdebug generate a profiling report by requesting a local PHP file
  3. Load webgrind in the browser and select a file in the popup-menu at the top
  4. Press update, and hopefully everything should work

The wiki on Google Code has more on configuring webgrind.


1) Download XDebug from their download page.

2) Put all DLL files in your PHP extension directory: C:\wamp\bin\php\php5.x.x\ext

3) Add the following line in your php.ini file located in C:\wamp\bin\php\php5.x.x:

zend_extension = c:\wamp\bin\php\php5.3.0\ext\php_xdebug-2.1.0-5.3-vc6.dll

4) Add also the following section to your php.ini (search for the [xdebug] section first to make sure it does not exist yet):

[xdebug]
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "c:\wamp\www\webgrind\tmp"
xdebug.profiler_output_name = cachegrind.out.%t.%p

5) Restart Wamp and verify that the extension was loaded. To do so, add a file pi.php in C:\wamp\www\ and put the following code in it:

<?php
    phpinfo();
?>

6) Check the output by opening your browser at http://localhost/pi.php and search for XDebug.

7) Download Webgrind from their download page and extract in in your www folder.

8) Edit the config.phpfile located in C:\wamp\www\webgrind\ to change the storage directories:

static $storageDir = 'c:\wamp\www\webgrind\tmp';
static $profilerDir = 'c:\wamp\www\webgrind\tmp';

9) In the Webgrind directory where you have extracted the code, add an .htaccess file and put this content in it to avoid webgrind from profiling itself:

php_flag xdebug.profiler_enable 0

10) Rerun the http://localhost/pi.php script to generate some profiling data.

11) Open your browser with http://localhost/webgrind to display the results. Do not forget to click the Update button!

This answer is based on an answer provided by Jacob Moen. You can view the original source here.


It is good to watch if the application becomes SLOW, had problems with it because of the settings of Cachegrind.

Good luck!

My settings are Wamp 2.4, Apache 2.4, PHP 5.4 and MySQL 5.6

[Portugues pt_BR]

É bom prestar atenção se a aplicação se tornar LENTA, tive problemas com isso por causa das configurações do cachegrind.

Boa sorte!

Minhas configurações são Wamp 2.4, Apache 2.4, PHP 5.4 e MySQL 5.6


Update the PHP.INI with these parameters

  • xdebug.profiler_enable = 1
  • xdebug.profiler_enable_trigger = 1

RESTART ALL SERVICES

this should be work.


You don't have to do much....

I just edited the line to be

xdebug.profiler_enable = 1

Thats all buddy. Totally works!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜