linux下php调试工具xdebug安装配置
xdebug简介
Xdebug是php的一款调试工具,是基于zend的一个扩展,可以用来跟踪,调试和分析PHP程序的运行状况。如变量,函数调试,性能监测,代码覆盖率等
xdebug安装
1.下载xdebug源程序
git clone git://github.com/xdebug/xdebug.git
https://xdebug.org/download.php#releases
2.解压xdebug包
tar -xzvf xdebug.tgz
3.进入解压目录
cd xdebug
4.运行phpize
/usr/local/php/bin/phpize
5.编译
./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config
6.安装
make && make install
7.安装成功后会在php扩展目录生成类似xdebug.so的扩展
8.安装xdebug客户端xdebugclient (需要libedit扩展)
cd debugclient
./configure --with-libedit
make
make install
xdebug配置
1.在php.ini配置文件中添加如下内容
zend_extension="/wherever/you/put/it/xdebug.so"
2.如果是php5.3之前版本线程安全,添加如下内容代替上面1的内容
zend_extension_ts="/wherever/you/put/it/xdebug.so"
3.自从php5.3之后zend_extension_ts, zend_extension_debug不再使用
4.xdebug的一些其他配置
;显示错误信息
xdebug.default_enable = 1
;函数调试
xdebug.auto_trace=on
xdebug.trace_output_dir
xdebug.trace_output_name
;Type: string, Default value: trace.%c
xdebug.collect_params = 1|3|4 (参数长度,参数值,参数=值)
xdebug.show_mem_delta=1 显示内存
xdebug.collect_return=1 显示返回值
xdebug.trace_options =1 追加日志
xdebug.collect_params=1
xdebug.collect_vars = 1
;开启性能分析
xdebug.profiler_enable=1
;性能分析日志保存目录
xdebug.profiler_output_dir = /data/logs/xdebug/
;性能分析日志文件名称
xdebug.profiler_output_name = cachegrind.out.log
;默认是如下格式,t时间,p进程id
;xdebug.profiler_output_name = cachegrind.out.%t.%p
;代码覆盖率
xdebug.coverage_enable = 1
;以下是远程调试配置
xdebug.remote_host= 127.0.0.1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.remote_log="/data/logs/xdebug/xdebug.log"
4.重启php使配置生效
性能分析日志工具
1.linux平台
工具KCacheGrind (Linux, KDE) https://kcachegrind.github.io/
2.win平台查看工具WinCacheGrind
相关网址
http://ceefour.github.io/wincachegrind/
https://sourceforge.net/projects/wincachegrind/
https://github.com/ceefour/wincachegrind/releases/tag/1.1
列名称含义
Self - Shows the execution time of the code in the current block
Cum. - Shows the total exuction time of functions that the current function (Self) calls
Avg vs. Total: Average is average time per call, Total is the total time spend in all calls.
3.Web方式查看webgrind
https://github.com/jokkedk/webgrind
linux下php调试工具xdebug安装配置的更多相关文章
- PHP 调试工具Xdebug安装配置
## PHP 调试工具Xdebug安装配置 一.Xdebug 介绍 Xdebug是一个开源的PHP程序调试工具,可以使用它来调试.跟踪及分析程序运行状态.当然,Xdebug需要结合PHP的编辑工具来打 ...
- Linux下apache+phppgadmin+postgresql安装配置
Linux下apache+phppgadmin+postgresql安装配置 操作系统:CentOS 安装包:httpd(首选yum), php(包括php以及php-pgsql,php-mbstri ...
- PHP调试工具Xdebug安装配置教程
说道PHP代码调试,对于有经验的PHPer,通过echo.print_r.var_dump函数,或PHP开发工具zend studio.editplus可解决大部分问题,但是对于PHP入门学习的童鞋来 ...
- PHP性能调优---PHP调试工具Xdebug安装配置教程
说到PHP代码调试,对于有经验的PHPer,通过echo.print_r.var_dump函数,或PHP开发工具zend studio.editplus可解决大部分问题,但是对于PHP入门学习的童鞋来 ...
- Linux下xampp集成环境安装配置方法 、部署bugfree及部署禅道
XAMPP(Apache+MySQL+PHP+PERL)是一个功能强大的建站集成软件包.XAMPP 是一个易于安装且包含 MySQL.PHP 和 Perl 的 Apache 发行版.XAMPP 的确非 ...
- Windows和Linux下apache-artemis-2.10.0安装配置
window下安装配置 一.官网下载 http://activemq.apache.org/artemis/download.html 二.百度网盘下载 链接:https://pan.baidu.c ...
- linux下xampp集成包安装配置方法
1.查看你linux系统的位数,是32位的还是64位的.使用uname -a命令查看. 显示有 x86_64则说明你是64位内核, 跑的是64位的系统. i386, i686说明你是32位的内核, 跑 ...
- linux下Django Nginx+uwsgi 安装配置
原文链接 在前面的章节中我们使用 python manage.py runserver 来运行服务器.这只适用测试环境中使用. 正式发布的服务,我们需要一个可以稳定而持续的服务器,比如apache, ...
- Python 虚拟环境 | Mac/Linux下如何避坑安装配置Virtualenv
1.为什么要使用虚拟环境 在Python中,不同的应用可能需要用到不同版本的第三方包,而这些第三方包被统一存放到目录site-packages中,不同版本的包容易相互覆盖,如安装Django 2.1时 ...
随机推荐
- ios 字体设计
ref: http://ju.outofmemory.cn/entry/217705 ref:http://gold.xitu.io/entry/57958a41128fe10056be13b1 下面 ...
- 深入理解SQL的四种连接
SQL标准 select table1.column,table2.column from table1 [inner | left | right | full ] join table2 on t ...
- Python3基础 使用for循环 删除一个列表中的重复项
镇场诗: 诚听如来语,顿舍世间名与利.愿做地藏徒,广演是经阎浮提. 愿尽吾所学,成就一良心博客.愿诸后来人,重现智慧清净体.-------------------------------------- ...
- eclipse 标签标题乱码解决方法
一般出现此类问题都是由于更改本地语言设置引起的. 解决办法: 1.恢复到原来默认的语言和地域 2.更改eclipse主题(Window-->preferences-->General--& ...
- HDU -2100-Lovekey
题目链接 http://acm.hdu.edu.cn/showproblem.php?pid=2100 这题开始一直想着先把26进制转换成10进制,在转换成26进制,又200个字符因而行不通, 直接卡 ...
- gcd-函数
在网上看到了这个函数 int gcd(int a,int b){if(a==0) return b; if(b==0) return a; return gcd(b,a%b);} 是求最大公约数的 有 ...
- Backbone源码解读(一)事件模块
Backbone源码浅读: 前言: Backbone是早起的js前端MV*框架之一,是一个依赖于underscore和jquery的轻量级框架,虽然underscore中基于字符串拼接的模板引擎相比如 ...
- redhat+11g+rac 安装数据库软件时只有一个节点可选
在安装数据库软件时,只能检测到一个节点 650) this.width=650;" title="捕获.JPG" src="http://s3.51cto.co ...
- Mac 安装Rudy环境 pod安装前的准备工作
之前已经说过怎么使用pod 今天说一下安装pod之前的准备工作 首先呢就是Rudy 环境(前提是你已经安装了Xcode) 在终端输入一下命令 期间可能也许会要你输入密码 curl -L https:/ ...
- WebRTC音视频引擎研究(2)--VoiceEngine音频编解码器数据结构以及参数设置
1.VoiceEngine Codec数据结构 WebRTC中,用一个结构体struct CodecInst表示特定的音频编解码器对象: struct CodecInst { int pltype; ...