Search code examples
phpconfigurationwampvar-dump

hard to read when doing var_dump


I have recently installed the new wampserver 2.5 (with php 5.5.12) due to a problem I had with the wamp I had installed on my laptop.

The thing is that when doing var_dump the info is not displayed as it used to display, the new format is for example>

array(4) { ["title"]=> string(0) "" ["type"]=> array(3) { ["registered"]=> string(1) "1" ["prepay"]=> string(1) "2" ["preregistered"]=> string(1) "0" } ["date"]=> array(3) { ["age"]=> string(0) "" ["from"]=> string(0) "" ["to"]=> string(0) "" } ["number"]=> string(0) "" }

which is unreadable! How come I used to see before like this when doing a var_dump? I didn't have to user xdebug or anything like it, neither use the tags.. how do I fix this?

how I used to see when doing var_dump


Solution

  • WAMPServer has come with XDEBUG configured for many version now.

    With XDEBUG activated in WAMPServer 2.5 you will get a result that looks just like your picture, it is generated by XDEBUG, but when you deactivate XDEBUG, you will get the standard PHP output that you are complaining about.

    Look at your php.ini file ( use the wampmanager menus to edit it )

    wampmanager -> PHP -> php.ini
    

    At the bottom you should see this section which activates XDEBUG

    zend_extension = "d:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11.dll"
    ;
    [xdebug]
    xdebug.remote_enable = off
    xdebug.profiler_enable = off
    xdebug.profiler_enable_trigger = off
    xdebug.profiler_output_name = cachegrind.out.%t.%p
    xdebug.profiler_output_dir = "d:/wamp/tmp"
    xdebug.show_local_vars=0
    

    Make sure you have not removed this or amended any configurations.