Php xdebug in netbeans - how to see variable values?

I included xdebug in the php.ini file as follows:

 [XDebug] zend_extension = "D:\xampp\php\ext\php_xdebug.dll" xdebug.profiler_append = 0 xdebug.profiler_enable = 1 xdebug.profiler_enable_trigger = 0 xdebug.profiler_output_dir = "D:\xampp\tmp" xdebug.profiler_output_name = "cachegrind.out.%t-%s" xdebug.remote_enable = 0 xdebug.remote_handler = "dbgp" xdebug.remote_host = "localhost" xdebug.trace_output_dir = "D:\xampp\tmp" 

and my netbeans setup is the same as their guide. Now when I try Ctrl + F5 (after setting a breakpoint on line 140), it shows the following:

breakpoint set on line 140

How can I see the value of $user_id (or any other variable value) in the netbean console below?

Or Is there any way to debug PHP code by setting a breakpoint and checking the value of the variable in the CLI , e.g. python import pdb;pdb.set_trace() ??? so that the code is broken into a specific line (when the action is performed as a form of submitting or reloading the browser), and then I can check each variable to a breakpoint, even continue after a breakpoint

+7
python debugging php xdebug netbeans
source share
1 answer

1. Review the php.ini configuration.

 xdebug.remote_enable = 1 xdebug.remote_host = localhost xdebug.remote_port = 9000 

Also make sure your zend_extension = "D: \ xampp \ php \ ext \ php_xdebug.dll" is correct. On my computer, I have / instead of \, not sure if that matters ...

2. Reboot the server (optional if necessary).

3. Check the netbeans configuration in Tools-> options-> PHP-> Debugging

4. Check the project properties: "Browser" and "Run configuration"

If everything is correct, you can set a breakpoint in netbeans and debug debug: "Debug" -> "Debug project"

0
source share

All Articles