• Edit
  • Delete

xdebug Cheatsheet

disable xdebug html output

  • ini_set('html_errors', false);

php var_dump() limits the number of levels

Problem:

php var_dump() limits the number of levels to three.

 

Solution:

This is the default setting of xdebug.

 

To change the default, edit your xdebug.ini file and add the folllowing line:
xdebug.var_display_max_depth=n

 

Ubuntu:

  • sudo vi /etc/php5/conf.d/xdebug.ini
  • or
  • sudo vi /etc/php/7.0/mods-available/xdebug.ini
    • xdebug.var_display_max_depth = 15 
  • sudo apache2ctl restart

 

Moreover:

  • e.g. cut off string:
    • xdebug.var_display_max_data = 4096
  • heavily nested:
    • xdebug.max_nesting_level = 200