douhuang9886 2015-08-03 02:59
浏览 249
已采纳

Netbeans 8.0.2调试器断点不起作用

I just installed Netbeans for PHP (version 8.0.2). XDebug seemed to come with this installation. I'm trying to get the breakpoints and stepping through the code to work on my local machine, which is running WAMP, to work.

I've never used debugging for PHP; only with Excel VBA, so I'm familiar with how breakpoints and stepping through code works. It seems that this feature comes with Netbeans/XDebug.

But when I click on the debug button on the top middle of the screen, a bunch of buttons pop up. A good portion of them are greyed out and I am not able to use them. Specifically, the continue, step over, step into, step out, and run to cursor. The stop button is there, but works fine. When I click on debug, a new browser window opens and my code displays in the browser. It seems to ignore the breakpoint that I have placed in my code, though.

I have breakpoints in my code, just to see how it all works in a PHP IDE, but I can't seem to get the breakpoints to work. My code is really nothing fancy; all I have is what is below:

<?php
echo "Hello world!<br />";
echo "Google Chromium.";

I have a breakpoint on line 2 where it says "Hello world!" (I clicked on the left side of the code and a red box displayed next to the line of code).

I am not really sure where to start with fixing this. XDebug shows up in my phpinfo() as version 2.2.5. I've seen some questions address changing some of the parameters in php.ini, but each seems very specific to the person who posts problem. I've checked the port to make sure it's 9000, I've also placed/changed the following code in my php.ini file:

[xdebug]
xdebug.remote_enable = on
xdebug.profiler_enable = on
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0

xdebug.remote_handler=dbgp 
xdebug.remote_host=localhost 
xdebug.remote_port=9000

How do I get breakpoints to work and stepping through code to work with Netbeans and XDebug?

  • 写回答

1条回答 默认 最新

  • doushao5047 2015-08-18 14:28
    关注

    Check php.ini. Parameter xdebug.extended_info mast be equal to 1.

    xdebug.extended_info = 1
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀