and*_*rei 15 php profiling wamp xdebug
我刚刚安装了wamp,最新版本附带了webgrind,但我无法弄清楚它是如何工作的.它说
Select a cachegrind file above
Run Code Online (Sandbox Code Playgroud)
就这样.
jok*_*edk 16
Webgrind是一个名为cachegrind的分析文件格式的解析器/查看器.PHP扩展Xdebug可以(以及其他非常有用的东西)生成这些.要使webgrind工作,需要安装和启用Xdebug.
update,希望一切都行得通Google Code上的wiki有更多关于配置webgrind的内容.
Max*_*ime 14
1)从下载页面下载XDebug .
2)将所有DLL文件放在PHP扩展目录中: C:\wamp\bin\php\php5.x.x\ext
3)在您的php.ini文件中添加以下行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
Run Code Online (Sandbox Code Playgroud)
4)在php.ini中添加以下部分(首先搜索[xdebug]部分以确保它不存在):
[xdebug]
xdebug.profiler_enable = 1
xdebug.profiler_output_dir = "c:\wamp\www\webgrind\tmp"
xdebug.profiler_output_name = cachegrind.out.%t.%p
Run Code Online (Sandbox Code Playgroud)
5)重新启动Wamp并验证是否已加载扩展.要做到这一点,添加一个文件pi.php中C:\wamp\www\,把下面的代码吧:
<?php
phpinfo();
?>
Run Code Online (Sandbox Code Playgroud)
6)打开浏览器检查输出http://localhost/pi.php并搜索XDebug.
7)从下载页面下载Webgrind 并在您的www文件夹中解压缩.
8)编辑config.php位于的文件C:\wamp\www\webgrind\以更改存储目录:
static $storageDir = 'c:\wamp\www\webgrind\tmp';
static $profilerDir = 'c:\wamp\www\webgrind\tmp';
Run Code Online (Sandbox Code Playgroud)
9)在您已解压缩代码的Webgrind目录中,添加一个.htaccess文件并将其放入其中以避免webgrind自行分析:
php_flag xdebug.profiler_enable 0
Run Code Online (Sandbox Code Playgroud)
10)重新运行http://localhost/pi.php脚本以生成一些分析数据.
11)打开浏览器http://localhost/webgrind以显示结果.别忘了点击Update按钮!
这个答案是基于Jacob Moen提供的答案.您可以在此处查看原始来源.
| 归档时间: |
|
| 查看次数: |
16883 次 |
| 最近记录: |