xdebug

Why does xdebug not establish connection with NetBeans?

泪湿孤枕 提交于 2019-12-01 04:10:12
I try using xdebug with NetBeans to debug PHP. I start debug, and NetBeans waits for ever for a connection with xdebug. I have NetBeans 6.8 (latest version) with the latest MAMP package installed on my mac. My php.ini looks like this: [xdebug] ;zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so" xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=localhost xdebug.remote_port=9000 If your php.ini really looks like what you posted, you have to un-comment the zend_extension line (i.e. remove the ' ; ' at its

Break on property change in Xdebug

╄→гoц情女王★ 提交于 2019-12-01 03:12:00
问题 I'm trying to find out where a certain property of a certain object gets modified. Due to PHP's highly dynamic nature ( $o->$prop = $val and such) this is practically impossible to do by simple code analysis. Is there a way to start a debugging session and break at the line where the property gets modified? (Adding a magic __set with a conditional xdebug_break() call to the class might help in simple cases, but if the class or one of its ancestors already has a magic setter, it can get very

XDebug profiling in PHP - can't get output

非 Y 不嫁゛ 提交于 2019-12-01 02:53:59
I've got a strange issue. I've setup XDebug to profile a PHP application we're working on. I believe everything is setup correctly but I get no output when I run it. My configuration looks like this: zend_extension="/usr/local/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so [XDebug] xdebug.profiler_append = 1 xdebug.profiler_enable = 0 (I've tried this both on and off) xdebug.profiler_enable_trigger = 1 xdebug.profiler_output_dir = "/debug/xdebug/profiler_output_dir" xdebug.profiler_output_name = "cachegrind.out.%p" All the phpinfo() settings match up like they should. The permissions

Xdebug profiler is not working?

六眼飞鱼酱① 提交于 2019-12-01 02:33:28
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 Xdebugs profiler which creates files in the profile output directory. Those files can be ; read by

PHPStorm+Xdebug断点调试配置

自作多情 提交于 2019-12-01 02:05:25
下载xdebug 注:phpstudy有自带xdebug 下载链接 修改PHP.ini如下 [xDebug] xdebug.profiler_append = 0 xdebug.profiler_enable = 1 xdebug.profiler_enable_trigger = 0 xdebug.profiler_output_dir ="D:\phpStudy\tmp\xdebug" xdebug.trace_output_dir ="D:\phpStudy\tmp\xdebug" xdebug.profiler_output_name = "cache.out.%t-%s" xdebug.remote_enable = 1 xdebug.remote_handler = "dbgp" xdebug.remote_host = "127.0.0.1" zend_extension="D:\phpStudy\php53n\ext\xdebug.dll" xdebug.idekey= PHPSTROM 设置服务器 设置debug浏览器 测试一下我们的输出结果 看到程序断在了断点处并且debuger输出了接收到的值。 完成任务,祝大家debug愉快 来源: oschina 链接: https://my.oschina.net/u/2654135/blog/909953

PHPSTORM+XDEBUG断点调试PHP

萝らか妹 提交于 2019-12-01 02:05:05
个人认为,对有有经验的程序员,使用echo、print_r()、print_f()、var_dump()等函数足以调试php代码,如果你不喜欢这样的话,xdebug就是一个非常好的php调试工具。 下面来说说安装教程: 1.首先下载相应的php_xdebug.dll,下载地址: http://www.xdebug.org/download.php 2.将下载文件 复制到你的php下的ext目录里。 3.编辑php.ini文件,加入下面信息: [Xdebug] zend_extension=D:\xampp\php\ext\php_xdebug.dll (Win) xdebug.profiler_enable=on xdebug.trace_output_dir="../Projects/xdebug" xdebug.profiler_output_dir="../Projects/xdebug" 后面的目录“../Projects/xdebug”为你想要放置Xdebug输出的数据文件的目录,可自由设置。 参数参考设置:   xdebug.default_enable=on   ;显示默认的错误信息   xdebug.auto_trace=on   ;自动打开“监测函数调用过程”的功模。该功能可以在你指定的目录中将函数调用的监测信息以文件的形式输出。此配置项的默认值为off。  

解决家庭网络下PHPStorm无法连接线上主机xdebug服务的配置问题

亡梦爱人 提交于 2019-12-01 02:04:52
目前的现象是phpstorm + xdebug能调试连上我笔记本上虚拟机中的web服务, 却连不上在线web主机. 擦擦, 以前也没直接连到在线主机来调试, 一直都是本地调试, 这次情况特殊就歇菜了. 搞了一个通宵, 累死找到原因. 原来xdebug是 把本地的phpstorm IDE作为调试过程中的服务端的, web服务运行的主机才是client!!!! 然后我设置web服务上的xdebug一直都是接受全部调试回连请求 xdebug.remote_connect_back = 1 没有指定ip, 这样虚拟机中的web服务倒是能回连上笔记本实机中的phpstorm 可是我那个在线的web服务主机要socket回连到我的phpstorm就得穿过光纤猫->穿过路由器->再到我的phpstormIDE, 由于xdebug检测到的公网ip是分配给光纤猫的, 这样调试回连的socket直接被中间者光纤猫给截断了, 无法到达我笔记本上的phpstorm。 可见, debug过程中, C/S架构,谁是C, 谁是S, 思想概念上颠倒个对象顺序直接就坑死我了, 以前也没看太仔细xdebug的架构介绍, 这次就擦擦了. 如果phpstorm是作为debug过程的C端的话, 是万万不会浪费我一通宵的额 也罢, 找到原因就解决问题, 访问光纤猫配置页, 将其DMZ主机设置为我的笔记本,

PhpStorm8 + Vagrant +XDebug 配置

﹥>﹥吖頭↗ 提交于 2019-12-01 02:03:58
vagrant默认已经安装好xdebug,可通过phpinfo()来确认。 下面是配置的步骤: Xdebug 与 PhpStorm 如何与 vagrant 进行沟通? xdebug 与 phpstorm 之间的通信是client-server模式。其中 xdebug 是 client, 他需要访问 phpstorm。而 vagrant 就是他们之间沟通的桥梁。 配置xdebug 首先通过命令行连接上vagrant vagrant ssh 再输入命令 netstat -r 记住Gateway那一项的IP,通常是: 10.0.2.2 打开xdebug配置文件 cd /etc/php5/mods-available vi xdebug.ini 将该文件内容改为: zend_extension=/usr/lib/php5/20131226/xdebug.so xdebug.idekey="debugit" xdebug.remote_host=10.0.2.2 xdebug.remote_port=10000 xdebug.remote_enable=1 xdebug.remote_autostart=0 xdebug.remote_handler="dbgp" 配置phpstorm,让他能够接受来自xdebug的请求 ctrl+alt+s 打开phpstorm 配置窗口,进入

PHP-----浅谈垃圾回收机制

时光总嘲笑我的痴心妄想 提交于 2019-12-01 01:31:25
前言 大多数编程语言都会有自身的垃圾回收机制,php也不例外。经常听很多人说gc,也就是垃圾回收器,全程为Garbage Collection。 在php5.3之前,是不包括垃圾回收机制的,也没有专门的垃圾回收器,实现垃圾回收就是简单判断一下变量的zval的refcount是否为0,是的话就释放。 但是如果这么简单的判断垃圾回收的话,很容易引起程序过程中内存溢出。如果存在"自身指向自身"的情况的话,那么变量将无法回收早成内存泄露,所以从php5.3开始就出现了专门负责清理垃圾数据防止内存泄露的垃圾回收器。 引用计数的基本知识 我们要了解GC,那么首先要了解引起垃圾回收的基数是什么。 在php中,每个变量存在一个叫“zval”的变量容器中。一个zval变量容器,除了包含变量的类型和值,还包括另外两个字节的额外信息。第一个是"is_ref"。第二个是"refcount"。 is_ref是一个布尔类型的值,用来标示这个变量是否属于引用集合。通过这个字节,php引擎才能把普通变量和引用变量区分开来,由于php允许用户通过"&"来使用自定义的引用,所以zval中还有一个内部引用计数机制,来进行优化内存。 refcount用来表示这个zval变量容器的变量的个数。所有符号存在一个符号表当中,每个符号都有作用域。 通俗的讲: 1、 refcount就是多少个变量是一样的用了相同的值

Why does xdebug not establish connection with NetBeans?

[亡魂溺海] 提交于 2019-12-01 01:08:14
问题 I try using xdebug with NetBeans to debug PHP. I start debug, and NetBeans waits for ever for a connection with xdebug. I have NetBeans 6.8 (latest version) with the latest MAMP package installed on my mac. My php.ini looks like this: [xdebug] ;zend_extension="/Applications/MAMP/bin/php5/lib/php/extensions/no-debug-non-zts-20060613/xdebug.so" xdebug.remote_enable=on xdebug.remote_handler=dbgp xdebug.remote_mode=req xdebug.remote_host=localhost xdebug.remote_port=9000 回答1: If your php.ini