I'm using Netbeans 6.7 and XDebug to debug a PHP site on my machine, launching the request from within Netbeans (Project->Debug). This works fine, and is very useful.

我的问题是:是否可以将调试器附加到传入的任何请求,而不仅仅是从Netbeans中启动的请求?

ie,而不是单击"调试",将Netbeans置于一种模式,在此模式下,调试器将启动并附加到下一个传入的请求.

我觉得这可能是个愚蠢的问题,但如果可能的话,那就太好了.

Edit:多点信息

我的系统(Ubuntu 9.04)设置如下:

目录/etc/php5/conf.d/xdebug.ini

zend_extension=/usr/lib/php5/20060613/xdebug.so

xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey=netbeans-xdebug

Netbeans PHP调试选项默认为:

Debugger Port: 9000
Session ID: netbeans-xdebug
Stop at the First Line: ticked

我的/etc/hosts文件将www.mywebsite.com重定向到localhost

如果我点击Netbeans中的debug按钮,那么Firefox将以地址http://www.mywebsite.com?XDEBUG_SESSION_START=netbeans-xdebug启动,调试器将按预期工作.

但如果我只是浏览到http://www.mywebsite.com?XDEBUG_SESSION_START=netbeans-xdebug,这不会启动Netbeans中的调试器.

我也试过设定xdebug.remote_host=www.mywebsite.com,但这没什么区别.

此外,我还启用了xdebug.remote_log,这显示了从netbeans内部开始时的信息,但没有显示外部请求的信息.所以我认为XDebug根本看不到外部请求.

推荐答案

go to project properties > run configuration > advanced > debug url and check do not open web browser (*). do not set the host under debugger proxy. save these settings. in the project window, on your project: right mouse click > debug (this starts listening for debug connections). no browser is started. enter http://www.mywebsite.com?XDEBUG_SESSION_START=netbeans-xdebug in your browser. it should break in netbeans. at least that's what happens here :)

(*)你可能还需要设定一个path mapping——对我来说,它在没有

Linux相关问答推荐

C++17/Linux:信号未解锁单独线程中被阻止的网络套接字调用

AWK打印到文件正在追加,而不是覆盖

如何在Linux上获取clang中的模板实例化统计?

通过 ssh 在远程计算机上按索引访问数组元素

命令行中使用`..`为什么会导致权限被拒绝错误?

如何从linux调度程序中屏蔽一个cpu(防止它调度线程到那个cpu上)?

增加 mysql docker 中的 max_allowed_pa​​cket 大小

为什么我不能将 Unix Nohup 与 Bash For 循环一起使用?

使用 AWS cli 从 AWS 机密管理器解析机密

如何在 linux ElementaryOS 中修复 Genymotion,但未找到错误CXXABI_1.3.8

yum 可以告诉我哪些存储库提供了特定的包吗?

Ant 找不到 javac,在 Ubuntu 上不会设置 JAVA_HOME

将原始数据发送到 TCP 服务器的 Linux 工具

我可以告诉 Linux 不要换出特定进程的内存吗?

有什么方法可以在linux中保留但不提交内存?

什么是 linux 脚本中的 start-stop-daemon?

System.currentTimeMillis 是否总是返回一个值 >= 以前的调用?

Bash 将 awk 的输出捕获到数组中

如何在 Linux 中将 .so 文件添加到 java.library.path

如何用逗号而不是空格分割列表