用xdebug对php进行性能分析
2016-06-11 14:41
309 查看
1. 下载PHP的XDebug扩展,网址:http://xdebug.org/
2. 将下载的模块(php_xdebug-2.0.5-5.2.dll)放到PHP的安装的 ext 目录下;
3. 配置php.ini文件,将以下几行添加
extension=php_xdebug-2.0.5-5.2.dll
[Xdebug]
xdebug.auto_trace = 1
xdebug.collect_params = 1
xdebug.collect_return = 1
xdebug.profiler_append = 0xdebug.profiler_enable=1
xdebug.profiler_enable_trigger = 1#需要分析的时候,加XDEBUG_PROFILE参数
xdebug.profiler_output_name = "cachegrind.out.%p"#格式一定要对
xdebug.profiler_output_dir = "E:/Projects/xdebug"
4. 重启Apache服务器。
5. <?php echo phpinfo();?>如果输出的内容中有看到xdebug,说明安装配置成功。
6. 在Windows平台下,可以用客户端(Windows):WinCacheGrind WinCacheGrind 这个软件来打开这些文件。可以更直观地显示其中内容:
下载地址:http://sourceforge.net/projects/wincachegrind/
2. 将下载的模块(php_xdebug-2.0.5-5.2.dll)放到PHP的安装的 ext 目录下;
3. 配置php.ini文件,将以下几行添加
extension=php_xdebug-2.0.5-5.2.dll
[Xdebug]
xdebug.auto_trace = 1
xdebug.collect_params = 1
xdebug.collect_return = 1
xdebug.profiler_append = 0xdebug.profiler_enable=1
xdebug.profiler_enable_trigger = 1#需要分析的时候,加XDEBUG_PROFILE参数
xdebug.profiler_output_name = "cachegrind.out.%p"#格式一定要对
xdebug.profiler_output_dir = "E:/Projects/xdebug"
4. 重启Apache服务器。
5. <?php echo phpinfo();?>如果输出的内容中有看到xdebug,说明安装配置成功。
6. 在Windows平台下,可以用客户端(Windows):WinCacheGrind WinCacheGrind 这个软件来打开这些文件。可以更直观地显示其中内容:
下载地址:http://sourceforge.net/projects/wincachegrind/
相关文章推荐
- 用cakephp快速开发php应用--用户及权限控制
- php.ini常用配置
- iis下手动配置php
- 仿微博php生成短网址
- PHP中htmlentities和 htmlspecialchars区别
- 进程组、作业、会话
- PHP中strpos、strstr和stripos、stristr函数分析
- FastCgi与PHP-fpm之间的关系
- 提高PHP代码执行效率小结
- ubuntu中安装ftp服务器
- ubuntu安装php常见错误集锦
- Ubuntu编译PHP7问题
- laravel框架中所蕴含的两个重要的面向对象设计模式
- Vsftpd软件包的获取与安装
- PHP 加密的几种方式
- PHP手工注入
- ubuntu 下NetworkX,matplotlib的安装和使用(转)
- 用ftplib爆破FTP口令
- PHP学习笔记-数组
- Yii2高级模版使用composer在windows系统上安装