【问题标题】:configure xdebug debugger so to to debug with netbeans a script started through a web browser配置 xdebug 调试器,以便使用 netbeans 调试通过 Web 浏览器启动的脚本
【发布时间】:2019-05-26 14:35:54
【问题描述】:

我正在尝试配置 xdebug 调试器,以便使用 netbeans 调试通过 Web 浏览器启动的脚本

场景

mypc localhost
linux ubuntu16.04
apache2.4
php7.2
netbeans8.2 IDE
both script.php and IDE in mypc

xdebug 配置

$ sudo nano /etc/php/7.2/mods-available/xdebug.ini

zend_extension=xdebug.so
;debugger_clients (remote)
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
;xdebug.remote_host=localhost
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_connect_back=On

$ sudo nano /etc/php/7.2/apache2/php.ini

output_buffering=Off

$ sudo netstat -ltnp | grep :9000

空输出

netbeansIDE,工具 > 选项 > PHP > 调试 >

SessionID:netbeans-xdebug

调试器端口:9000

然后我创建了一个netbeans项目并进行了配置

如果我尝试从 netbeans 以调试模式执行脚本(单击调试>) 调试模式有效!!!

如果我尝试从 Web 浏览器以调试模式执行脚本,则调试模式不起作用!!!

http://localhost/path/to/script/index.php?XDEBUG_SESSION_START=netbeans-xdebug

脚本执行不中断!!!

我也尝试安装了 Firefox 扩展“Xdebug Helper for Firefox”,但没有成功

【问题讨论】:

  • 这不是 WP 问题,属于 stackoverflow

标签: php debugging netbeans


【解决方案1】:

这是因为 netbeans 并不总是在监听

netbeans 仅在您单击 Debug> 按钮后才会在端口 9000 上侦听

这不是一个很大的限制 没关系

【讨论】:

    猜你喜欢
    • 2023-03-08
    • 1970-01-01
    • 1970-01-01
    • 2011-02-26
    • 2011-12-10
    • 2015-02-21
    • 1970-01-01
    • 1970-01-01
    • 2016-03-23
    相关资源
    最近更新 更多