simPod
simPod

Reputation: 13456

Xdebug var_dump formatting osx

I have installed xdebug using brew (brew install php55-xdebug), I can see it loaded in when I print phpinfo(). I walked through stackoverflow and found in the answers that these properties should be set to these values as I did:

HTML_ERRORS are ON html_errors

xdebug.overload_var_dump is ON xdebug.overload_var_dump

xdebug.remote_autostart is ON xdebug.remote_autostart

xdebug.default_enable is ON xdebug.default_enable

And my question is why my var_dump outputs aren't formatted with colors etc.

When I use xdebug_var_dump() it's not colored either.

The only thing I can achieve is this ⬇︎ by adding <pre> tags but can't get those colors working... Thanks

var_dump screen

Upvotes: 1

Views: 641

Answers (2)

Matthew Leffler
Matthew Leffler

Reputation: 1426

Set xdebug.cli_color = 2 to your /etc/php/conf.d/xdebug.ini file. See here:

If this setting is 1, Xdebug will color var_dumps and stack traces output when in CLI mode and when the output is a tty. On Windows, the ANSICON tool needs to be installed.

If the setting is 2, then Xdebug will always color var_dumps and stack trace, no matter whether it's connected to a tty or whether ANSICON is installed. In this case, you might end up seeing escape codes.

Upvotes: 1

Jeremiah Winsley
Jeremiah Winsley

Reputation: 2557

Try setting

xdebug.default_enable = 1

Upvotes: 0

Related Questions