Netbeans中的Xdebug:不会在"web root's"目录中的文件内的断点处停止上层资料夹 [英] Xdebug in Netbeans: not stopping on breakpoint inside file in "web root's" parent folder

查看:75
本文介绍了Netbeans中的Xdebug:不会在"web root's"目录中的文件内的断点处停止上层资料夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有这样的目录树的netbeans项目:

I have a netbeans project with a directory tree like this:

<source folder>
|
|---> gui <web root folder>
|      |
|      L---> datos.php
|
L---> index.php

datos.php将工作目录更改为..(源文件夹),并包含index.php,如下所示:

datos.php changes the working directory to .. (source folder) and includes index.php like this:

chdir('..');
require 'index.php';

如果我在datos.php中放置一个断点,调试器会在其上正确断开,但是在index.php中放置一个断点时,它将忽略它.

奇怪的是6个月前,我遇到了同样的问题,并且能够修复它.现在我不知道为什么它停止工作,然后我又做了什么来解决它.

The strange thing is 6 months ago I had the same problem and I was able to fix it. Now I don't know why it stopped working and what I did back then to fix it.

更多信息:

xdebug日志显示以下用于设置断点的命令:

xdebug log shows the following command for breakpoint setting:

breakpoint_set -i 315 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php -n 51
breakpoint_set -i 316 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/gui/datos.php -n 39 

在两种情况下,xdebug都以state ="enabled"进行响应

In both cases xdebug responds with state="enabled"

如果我手动调试,则可以使用以下命令设置断点,有效:

And if I debug manually, I can use the following command to set the breakpoint, which works:

breakpoint_set -i 315 -t line -s enabled -f file:///../index.php -n 51

但是我不知道如何使netbeans使用相同的 file:///../index.php 参数而不是 file:///来发出breakpoint_set命令Users/tomasgirardi/NetBeansProjects/datamed/index.php 或其他任何可以实现此目的的方式.

But I don't know how could I make netbeans issue the breakpoint_set command with the same file:///../index.php argument and not file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php or any other way I can make this work.

在此先感谢您的帮助!

推荐答案

断点再次起作用.我没有任何线索,为什么他们以前没有工作过,但现在他们做了.我也不记得在xdebug或Netbeans中进行任何更改.

Breakpoints are working again. I don't have any clues to why they didn't worked before but now they do. I can't remember doing any changes in xdebug or Netbeans either.

xdebug.log显示的内容与以前相同,但是现在它在设置的断点处停止了

xdebug.log shows me the same as before, but now it stops at the setted breakpoint:

<- breakpoint_set -i 4 -t line -s enabled -f file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php -n 51
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="breakpoint_set" transaction_id="4" state="enabled" id="14290001"></response>

<- run -i 5
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" command="run" transaction_id="5" status="break" reason="ok"><xdebug:message filename="file:///Users/tomasgirardi/NetBeansProjects/datamed/index.php" lineno="51"></xdebug:message></response>

但是,如果有人知道为什么会发生这种情况,分享它可能会有所帮助:也许我或其他人将来能够避免遇到类似的麻烦.

However, if anyone knows why this could had happend, sharing it could be helpful either way: probably me or someone else will be able to avoid having similar troubles in the future.

这篇关于Netbeans中的Xdebug:不会在"web root's"目录中的文件内的断点处停止上层资料夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆