Category Archives: PHP

Enabling XDebug for Netbeans and PHP

To enable XDebug, you need to edit the php.ini file in a text editor like gedit.

  • To start the gedit text editor, launch the Terminal and type the following command at the command prompt:
    sudo gedit

    If asked, enter the password specified for the root user during the installation of your operating system.

  • Open the file /etc/php5/apache2/php.ini or /etc/php/7.0/apache2/php.ini.
  • Add the following line to the file at the end of the “Dynamic Extensions” :
zend_extension=/usr/lib/php/20151012/xdebug.so
  • Add the following section in “Module Settings” before the [Date] section:
[debug]
; Remote settings
xdebug.remote_autostart=off
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000

; General
xdebug.auto_trace=off
xdebug.collect_includes=on
xdebug.collect_params=off
xdebug.collect_return=off
xdebug.default_enable=on
xdebug.extended_info=1
xdebug.manual_url=http://www.php.net
xdebug.show_local_vars=0
xdebug.show_mem_delta=0
xdebug.max_nesting_level=100
;xdebug.idekey=

; Trace options
xdebug.trace_format=0
xdebug.trace_output_dir=/tmp
xdebug.trace_options=0
xdebug.trace_output_name=crc32

; Profiling
xdebug.profiler_append=0
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=0
xdebug.profiler_output_dir=/tmp
xdebug.profiler_output_name=crc32
  • Save the php.ini file and quit gedit.