Saturday, 21 February 2015

Debugging PHP Code with Netbeans IDE & WAMP Server

Step 1)
Open php.ini file and remove the content which are present below [xdebug]
and now paste this content in place of that.
[xdebug]
xdebug.remote_enable = 1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.idekey = netbeans-xdebug
xdebug.remote_enable = 1
xdebug.profiler_enable = 0
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=9

Step 2)
Open Netbeans -> Tools -> Options -> php -> change debugger port to 9001 -> click ok/save

Step 3)
Now create new php project and set break point and start debugging!

Please comment for any query

Cheers & Happy coding!