I'd like to see the colors and formatting that can come with var_dump. In my php.ini
html_errors
is set to On
. This is confirmed by phpinfo()
.
My PHP version is 5.3.3 on Ubuntu 10.10. Anybody an idea?
I'd like to see the colors and formatting that can come with var_dump. In my php.ini
html_errors
is set to On
. This is confirmed by phpinfo()
.
My PHP version is 5.3.3 on Ubuntu 10.10. Anybody an idea?
There's a php tool to do even more than xdebug's var_dump and it's a simple PHP class, so can be used on any environmment:
http://kint-php.github.io/kint/
Note: Maerlyn's approach should be taken for its simplicity. I wasn't aware of php5-xdebug being in the repos. I've decided to leave this answer because I feel it adds some value to future readers.
Install Xdebug
You should see something like:
Installing '/usr/lib/php5/20090626+lfs/xdebug.so'
when it finishes installing. Make note of the20090626+lfs
portion.Edit the php.ini
Add this to it:
Restart apache
Now when you do a var_dump it should be formatted, this is assuming
html_errors
isOn
.you could use a javascript library to do the syntax highlighting. something like: http://alexgorbatchev.com/SyntaxHighlighter/ but there are many other options as well.
You're looking for XDebug.
and you're done.