簡體   English   中英

Netbeans / XDebug斷點

[英]Netbeans / XDebug broken breakpoints

我正在使用Netbeans為我的PHP應用程序設置xdebug,該應用程序托管在本地xampp安裝(Windows 7)上

根據netbeans / xdebug文檔,安裝和命令行測試成功並且可以正常工作。 但是,當我在代碼中添加斷點時,無論我將其放置在代碼中的何處,該斷點都將顯示為“斷點”。 當我運行帶有調試器的應用程序時,它無法在這些斷點處停止。

我已經做了很多搜索,但是還沒有得到很好的解釋,有人在這里提出建議嗎?

謝謝

解決方案1:

您需要在項目源代碼和Xdebug輸出之間配置正確的映射。 你可以在這里做:

Project Window -> right click on project name -> Properties -> Run Configuration -> Advanced -> Path mapping

解決方案2:

檢查php信息是否正確配置了xdebug。 您可以在空的php文件中通過phpinfo()進行檢查,並在瀏覽器中運行它:

<?php
 phpinfo();

嘗試去找:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans

然后在php.ini中(您可以在phpinfo()中檢查該字段的位置,添加以下部分:

[xdebug]
xdebug.remote_enable = On
xdebug.profiler_enable = On
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/xamp/tmp"
xdebug.remote_handler=dbgp
xdebug.remote_port=9100
xdebug.remote_host=localhost

(確保此目錄c:/ xamp / tmp是否存在)

然后在netbeans中:

Tools -> Options -> PHP -> Debugging

設置:調試器端口:9100並選擇“在第一行停止”

保存並調試它現在應該可以正常運行的應用程序。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM