xdebug

php的xdebug的配置、调试、跟踪、调优、分析

烈酒焚心 提交于 2019-11-30 03:49:56
xdebug 的 profiler 是一个强大的工具,它能分析 PHP 代码,探测瓶颈,或者通常意义上来说查看哪部分代码运行缓慢以及可以使用速度提升。Xdebug 2 分析器输出一种兼容 cachegrind 文件格式的分析信息。这允许你能使用出色的 KCacheGrind 工具(Linux,KDE)来分析你的 profiling 数据。在 Linux 可以使用你最喜欢的包管理器安装 KCacheGrind。 在 windows 系统上,有预编译的 QCacheGrind 二进制程序(QCacheGrind 是没有 KDE 绑定的 KCacheGrind)。 在 Mac OSX 系统上,这里也有怎样安装 QCacheGrind 的 说明 。 Windows 用户可以选择性的使用 WinCacheGrind 。它的功能不同于 KCacheGrind,所以 这个页面的 KCacheGrind 使用文档章节不适用于这个程序。WinCacheGrind 目前不支持 Xdebug 2.3 引入的 cachegrind 文件格式的的文件和函数压缩。 这也有一种可替代 profile 信息演示的工具叫做 xdebugtoolkit 。一款基于 web 前端叫做 Webgrind ,和一款基于 java 的工具叫做 XCallGraph 。 如果你不能使用 KDE(或者不想使用 KDE)的

mac 安装 Xdebug

孤街浪徒 提交于 2019-11-30 03:22:34
20190919 最近改用 vsCode ,php 调试使用 xdebug,需要安装 xdebug xdebug 安装怎么这么费劲? 1. 参考 https://www.jianshu.com/p/47fcf57b490e 感谢这位,基本上是照着他的来完成的 确认一下自己的环境 php -v PHP 7.2.8 (cli) (built: Jul 19 2018 12:15:24) ( NTS ) Copyright © 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright © 1998-2018 Zend Technologies with Zend OPcache v7.2.8, Copyright © 1999-2018, by Zend Technologies pecl -V PEAR Version: 1.10.5 PHP Version: 7.2.8 Zend Engine Version: 3.2.0 Running on: Darwin dhbm-on-mac20180816.local 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64 3.

使用xdebug对php做性能分析调优

こ雲淡風輕ζ 提交于 2019-11-30 01:48:31
作为PHP程序员我们或多或少都了解或使用过xdebug。此文章记录安装和配置xdebug,以及如何使用它来分析php程序。 我的机器环境: mac , php 安装 xdebug 推荐使用 pecl 安装扩展 pecl install xdebug注:可以选择版本, https://pecl.php.net/package/xdebug 启用和配置 如果不知道php的配置文件,可以用 php --ini 查看 启用 xdebug,添加一个独立的 ext-xdebug.ini 到 php 的配置目录 [xdebug] zend_extension="xdebug.so" # profiler功能的开关,默认值0,如果设为1,则每次请求都会生成一个性能报告文件。 # xdebug.profiler_enable=0 # 默认值是0,如果设为1 则当我们的请求中包含 XDEBUG_PROFILE 参数时才会生成性能报告文件 xdebug.profiler_enable_trigger=1 # 分析文件保存目录, 默认是 /var/tmp xdebug.profiler_output_dir="/var/tmp/xdebug" 现在使用 php -m 能看到 xdebug,并且使用 php --ri xdebug 能看到配置项都生效就ok了。 访问并生成分析文件 使用 fpm 要重启

Installing xdebug on MacOs Mojave - 'php.h' file not found

非 Y 不嫁゛ 提交于 2019-11-30 01:47:23
I try to install xdebug on MacOs Mojave but get this error /private/tmp/pear/install/xdebug/xdebug.c:25:10: fatal error: 'php.h' file not found Command Line Tools are installed. Steven I ran into this trying to compile xdebug on my system, I had to do the following to get it to work 1) (Re)install the command line tools (I had installed them at one point, but the files under /Library/Developer/CommandLineTools/ were missing so I must have deleted it...) xcode-select --install 2) Reinstall the header files sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for

Installing xdebug with PHP 5.5

走远了吗. 提交于 2019-11-30 01:40:36
I've read quite a lot answers but couldn't figure out why xdebug doesn't work. php.ini: [xdebug] zend_extension="/usr/lib/php5/20090626/xdebug.so" php -v: PHP 5.5.6-1+debphp.org~precise+2 (cli) (built: Nov 21 2013 14:31:41) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies /usr/lib/php5/20090626/xdebug.so does exist. No zend optimizer in php.ini. Also if I try to install xdebug: pecl/xdebug is already installed and is the same as the released version 2.2.3 install

Xdebug profiler is not working?

China☆狼群 提交于 2019-11-30 01:31:57
问题 I using XAMPP and I have configure it in order to have virtual hosts for each project I create localy. In my php.ini I have enabled xdebug, and my scripts are working properly. I mean that any time there is a warning, notice, error, are reported by the xdebug. Now I would like to enable the Xdebug profiler, and I have make the following changes into my php.ini in order to allow the Xdebug profiler to generate the log file: ; xdebug.profiler_enable ; Type: integer, Default value: 0 ; Enables

How to easily Debug Layout Xml Warning/Error?

╄→尐↘猪︶ㄣ 提交于 2019-11-30 01:02:14
I got stuck on this error: Warning: simplexml_load_string(): Entity: line 46: parser error : Comment not terminated in */lib/Varien/Simplexml/Config.php on line 510 and Entity: line 46: parser error : Start tag expected, '<' not found in */lib/Varien/Simplexml/Config.php on line 510 It is clear that there is an issue in some Xml file, but really not easy for me to find out the needle in the big haystack :) Any good practice for that? If possible I would like to find a good practice that involves use Xdebug, or some log. It happens a lot of time in Magento to do some miss spelling. Roman Snitko

So eclipse and xdebug walk into a bar, and then my apache server dies

孤街醉人 提交于 2019-11-30 00:19:14
I am using windows xp x86, wamp, apache2, php 5.3 x86, eclipse php, and xdebug, running on localhost as both a virtualhost and an https virtualhost eclipse version info Eclipse for PHP Developers Version: Helios Release Build id: 20100617-1415 I had successfully managed, somehow, to setup eclipse and xdebug and all was well. Then I had to make an svn branch of my project, and reconfigure apache with 2 new virtual hosts, and update my windows host files. Now when I launch debug mode in eclipse everything dies. Specifically, If I set no breakpoints the app runs fine, save for the problem I'm

What's the Difference Between Extension and zend_extension in php.ini?

你离开我真会死。 提交于 2019-11-29 23:38:09
When I installed Xdebug through pecl , it added the following line to my php.ini file. extension="xdebug.so" and everything I used worked. Until today. Today I was having trouble setting up Xdebug for interactive debugging. I couldn't get anything working until I changed the above to zend_extension="/usr/local/lib/php/extensions/xdebug.so" (Caveat: I think this is what got me working, but I'm not 100% sure) This raised the question in my mind. What's the difference in loading an extension via extension= vs. zend_extension ? Milen A. Radev At the core of the PHP language (more like the

How to stop xdebug from stopping on first line with PhpStorm?

萝らか妹 提交于 2019-11-29 23:27:44
I'm having this weird problem. All my settings used to work OK, until I updated my version of PHP. I use macports and have the php5 and php5-xdebug ports installed. xdebug is working, but it is stopping on the first line of my script even though I have the option disabled in PhpStorm. There is no breakpoint there, and breakpoints in other parts of the code are working OK. If it helps, here is the xdebug portion of phpinfo (in two parts); https://dzwonsemrish7.cloudfront.net/items/3K3R2N1f1A190K372n0S/Screen%20shot%202011-08-18%20at%203.06.29%20PM.png?v=54c8964d , https://dzwonsemrish7