I'm trying to install a module, but its giving me errors during a drush enable. It shows the stack trace log and I can see it has something to do with the flag_lists_type during the install process. I can see there is an array in the output, but how do you print_r() this so I can get more debugging information?
You can use XDebug PHP extensions with the following suggested settings:
xdebug.default_enable = 1 ; bool: The stacktraces will be shown by default on an error event. xdebug.collect_vars = 1 ; bool: Gather information about which variables are used in a certain scope. xdebug.show_local_vars=1 ; int: Generate stack dumps in error situations. xdebug.collect_assignments=1 ; bool: Controls whether Xdebug should add variable assignments to function traces. xdebug.collect_params=4 ; int1-4: Collect the parameters passed to functions when a function call is recorded. xdebug.collect_return=1 ; bool: Write the return value of function calls to the trace files. xdebug.var_display_max_children=256 ; int: Amount of array children and object's properties are shown. xdebug.var_display_max_data=1024 ; int: Max string length that is shown when variables are displayed. xdebug.var_display_max_depth=5 ; int: How many nested levels of array/object elements are displayed. xdebug.show_mem_delta=0 ; int: Show the difference in memory usage between function calls. xdebug.show_exception_trace=1 ; bool: Show a stack trace whenever an exception is raised. xdebug.max_nesting_level=256 ; int: Controls the protection mechanism for infinite recursion protection.
Since you're experiencing Exception type of error, enabling
show_exception_trace will show a stack trace whenever an Exception or Error is raised (even if this Exception or Error is actually caught, so you can always disable it). Enabling
collect_params, will display the parameters passed to functions when a function call is recorded (including content of the arrays).
To verify your XDebug settings from CLI, run:
php -i | grep xdebug