简体   繁体   English

PHP Xdebug 与 NetBeans 和 Apache

[英]PHP Xdebug with NetBeans and Apache

I'm trying to do my first steps with PHP.我正在尝试使用 PHP 迈出第一步。 I decided to use NetBeans, which seams helpful.我决定使用 NetBeans,这很有帮助。

NetBeans is running on my local Windows machine. NetBeans 正在我的本地 Windows 机器上运行。 My testpage is running on an Apache2 webserver in my Ubuntu HyperV M.我的测试页在我的 Ubuntu HyperV M 中的 Apache2 网络服务器上运行。

Up to now everything works fine.到目前为止,一切正常。 Now I enabled remote debugging over Xdebug.现在我通过 Xdebug 启用了远程调试。 Therefore I added the following lines to the php.ini:因此,我在 php.ini 中添加了以下几行:

[debug]
; Remote settings
xdebug.remote_autostart=off
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.2.20
xdebug.remote_port=9000

The connection is ok and debugging works.连接正常,调试正常。 Unfortunately the debugger stops at each line and not only at my breakpoints.不幸的是,调试器停在每一行,而不仅仅是在我的断点处。 That makes my tests inefficient.这使我的测试效率低下。 Therefore my question is how to tell NetBeans to stop at breakpoints only?因此我的问题是如何告诉 NetBeans 仅在断点处停止?

Found the solution by myself.自己找到了解决方案。 There is an option "stop at first line" in the Netbeans PHP debugging settings. Netbeans PHP 调试设置中有一个选项“在第一行停止”。 Removing that did the trick.删除它就可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM