Viewed   102 times

I am using xdebug (php_xdebug-2.1.2-5.3-vc9.dll) on WAMP. When I use var_dump on a large object or variable it does not show the full variable.

array
'node' => 
  array
    'my_form' => 
      array
        'form' => 
          array
            ...

Without xdebug it shows as should be expected. I looked at the documentation but did not see a solution. Does anyone know how I can fix this so xdebug var_dump shows the full object?

 Answers

3

These are configurable variables in php.ini:

; with sane limits
xdebug.var_display_max_depth = 10
xdebug.var_display_max_children = 256
xdebug.var_display_max_data = 1024 


; with no limits
; (maximum nesting is 1023)
xdebug.var_display_max_depth = -1 
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1 

Of course, these may also be set at runtime via ini_set(), useful if you don't want to modify php.ini and restart your web server but need to quickly inspect something more deeply.

ini_set('xdebug.var_display_max_depth', '10');
ini_set('xdebug.var_display_max_children', '256');
ini_set('xdebug.var_display_max_data', '1024');

Xdebug settings are explained in the official documentation.

Saturday, November 26, 2022
5

The fast copy-paste way

sudo sh -c 'echo zend_extension=$(find /usr/lib/php/extensions -name "xdebug.so") >> $(php -qr "echo php_ini_loaded_file();") && apachectl restart'

This command do the following :

  • Finds the native Xdebug extension that comes with Xcode
  • Asks php which config file is loaded
  • Adds the Xdebug extension path in the config file
  • Restarts apache.

Compatible with Sierra, El Capitan & Yosemite with the bundeled apache, but untested with MAMP & XAMPP.

Before launching the command, make sure Xcode command line tools are installed : xcode-select --install

Monday, October 24, 2022
1

In Symfony4, 'dump' appears to be in Flex's 'debug-pack'

composer req debug-pack
Monday, December 26, 2022
 
1

Here's the documentation of the URL format for VS Code.

Thus, the xdebug config is:

xdebug.file_link_format="vscode://file/%f:%l"
Sunday, August 28, 2022
 
knossos
 
4

I sorted the problem out by adding

export PATH="$(brew --prefix homebrew/php/php70)/bin:$PATH"

on .bash_profile.

PHP 7.1 came with OSX 10.13.2, so default path was set to the pre-packed php, which shows the error on phpinfo.

Thursday, September 8, 2022
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :