Netbeans, xdebug : start debugging from browser

孤街浪徒 提交于 2019-12-10 10:32:50

问题


I have following problem about debugging PHP files in Netbeans using xdebug: when I debug directly PHP file everything works OK.

BUT:

If I debug whole file (starts in index.html) and after I click submit button which execute my PHP file, where is the breakpoint, It doesn't work. I wanna put breakpoint to PHP file to see what info I've received from my form in HTML page.

I want to stop program just after those 2 variables, sent through ajax:

$username = $_REQUEST["username"];
$password = $_REQUEST["password"];

Is it even possible?. Thank you!


回答1:


For the Netbeans settings look at my answer it's for linux but may help you.

In your index.html replace your action= with

<form action="yourphpfile.php?XDEBUG_SESSION_START=netbeans-xdebug" method="post" name="FormName">



回答2:


It's not necessary to modify your form code to enable debugging, as suggested by another answer here.

  1. Go to Project Properties > Run Configuration > Advanced... > Debug URL and check "Do not open web browser".
  2. Do not set the Host under Debugger Proxy.
  3. Save these settings.
  4. In the project window, go to Debug > Debug Project (Ctrl-F5). This starts listening for debug connections. No browser is started, but you'll see "Waiting for connection..." in your status bar (bottom).
  5. Install one of the plug-ins for your browser listed over at the 3rd step of Starting the Debugger.
  6. Enable debugging with the browser plug-in you just installed.
  7. Hit the URL you'd like to debug, fill out the form, and submit it.

This answer was partially sourced from Launch XDebug in Netbeans on an external request.



来源:https://stackoverflow.com/questions/13384947/netbeans-xdebug-start-debugging-from-browser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!