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!
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">
It's not necessary to modify your form code to enable debugging, as suggested by another answer here.
- Go to Project Properties > Run Configuration > Advanced... > Debug URL and check "Do not open web browser".
- Do not set the Host under Debugger Proxy.
- Save these settings.
- 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).
- Install one of the plug-ins for your browser listed over at the 3rd step of Starting the Debugger.
- Enable debugging with the browser plug-in you just installed.
- 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.