Skip to content

Instantly share code, notes, and snippets.

@rotexdegba
Last active August 17, 2022 23:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rotexdegba/6772148f9054f97f5a5eb606d785900d to your computer and use it in GitHub Desktop.
Save rotexdegba/6772148f9054f97f5a5eb606d785900d to your computer and use it in GitHub Desktop.
Debugging PHP with Xdebug in Netbeans 8.2
  • Make sure xdebug is enabled in your php installation
  • The following lines worked for me in my php.ini with PHP 7.2 on Windows 10
[xdebug]
zend_extension ="php_xdebug-2.6.1-7.2-vc15-x86_64.dll"
;xdebug.remote_enable=1
;xdebug.remote_handler=dbgp
;xdebug.remote_mode=req
;xdebug.remote_host=127.0.0.1
;xdebug.remote_port=9000

xdebug.remote_autostart=off
xdebug.remote_enable=on
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
;xdebug.remote_host="localhost:81"
;xdebug.remote_host=localhost:8000
xdebug.remote_host=10.0.0.200
;xdebug.remote_connect_back=1
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.idekey="netbeans-xdebug"

Obviously replace xdebug.remote_host=10.0.0.200 with the ipaddress of your machine running Netbeans

In Netbeans Tools > Options > PHP > Debugging

Debugger Port: 9000

Session ID: netbeans-xdebug

Maximum Data Length: 4096

I ran the built in php server in a terminal and then configured my netbeans project to Run As local website running on local server with Project Url: http://localhost:8000/ (my built-in PHP webserver was running on port 8000).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment