Netbeans 8.0.2调试器断点不起作用 [英] Netbeans 8.0.2 Debugger Breakpoints Not Working

查看:329
本文介绍了Netbeans 8.0.2调试器断点不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚安装了Netbeans for PHP(版本8.0.2). XDebug似乎随此安装一起提供.我试图获取断点并逐步执行代码以在运行WAMP的本地计算机上正常工作.

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.

我从未使用过PHP调试功能;仅适用于Excel VBA,因此我熟悉断点和单步执行代码的方式.似乎该功能是Netbeans/XDebug附带的.

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.

但是,当我单击屏幕顶部中间的调试按钮时,会弹出一堆按钮.其中很大一部分显示为灰色,我无法使用.具体来说,继续,跨步,进入,跳出并运行至光标.停止按钮在那里,但是可以正常工作.当我单击debug时,将打开一个新的浏览器窗口,并且我的代码显示在浏览器中.不过,似乎忽略了我在代码中放置的断点.

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.

我的代码中有断点,只是为了查看它们在PHP IDE中的工作方式,但是我似乎无法使断点正常工作.我的代码真的没什么花哨的.我所拥有的是下面的东西:

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.";

我在第2行有一个断点,上面写着"Hello world!". (我单击了代码的左侧,并在代码行旁边显示了一个红色框.)

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).

我不太确定从哪里开始修复此问题. XDebug在我的phpinfo()中显示为版本2.2.5.我已经看到一些问题可以解决更改php.ini中的某些参数的问题,但是每个问题似乎都是针对发布问题的人的.我检查了端口以确保它是9000,我还在php.ini文件中放置/更改了以下代码:

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

如何使断点工作并逐步执行代码以与Netbeans和XDebug一起工作?

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

推荐答案

检查php.ini.参数xdebug.extended_info mast等于1.

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

xdebug.extended_info = 1

这篇关于Netbeans 8.0.2调试器断点不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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