为 xdebug 增加 var_display_max_depth [英] Increase var_display_max_depth for xdebug

查看:35
本文介绍了为 xdebug 增加 var_display_max_depth的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近在我的 ststem 上安装了 xdebug,并想将 xdebug.var_display_max_depth 从 3 增加到 10.我该怎么做?

解决方案

有两种方法可以做到这一点.您也可以在本地和全局编辑此值.

  1. 本地设置(本地值")在您自己的 PHP 文件中:

    <?phpini_set('xdebug.var_display_max_depth', '10');//这里是你的代码...?>

  2. 全局设置(主值")在php.ini中:

    1. 首先找到您的 php.ini 文件.<子>
      • phpinfo()中,您可以从加载的配置文件"指令中了解它的位置.
      • 您还可以使用命令提示符/终端找到它:
        • Windows:php --ini |findstr/C:"加载的配置文件"
        • Linux/UNIX-like: php --ini |grep '加载的配置文件'
      • 使用

        I recently installed xdebug on my ststem and wanted to increase xdebug.var_display_max_depth from 3 to 10. How can I go about doing that?

        解决方案

        There are two ways to do that. You can edit this value locally and globally too.

        1. Local setting ("Local value") in your own PHP file:

          <?php  
              ini_set('xdebug.var_display_max_depth', '10');    
              // here comes your code...  
          ?>
          

        2. Global setting ("Master value") in php.ini:

          1. First locate your php.ini file.
            • In phpinfo(), you can get to know where it is from "Loaded Configuration File" directive.
            • You can also locate it using command prompt/terminal:
              • Windows: php --ini | findstr /C:"Loaded Configuration File"
              • Linux/UNIX-like: php --ini | grep 'Loaded Configuration File'
            • using php_ini_loaded_file(): <?php echo php_ini_loaded_file(); ?>
          2. Open your php.ini in a text editor file.
          3. You have to put something like the following to this file (in this example, I'm using php_xdebug-2.2.3-5.3-vc9-nts.dll (use http://xdebug.org/wizard.php to get to know which version you need)), and of course, you need to substitute <path to your XDebug> to the appropriate path:

            [Xdebug]  
            ;; <path to your XDebug> is like
            ;; C:\Program Files (x86)\PHP\v5.3\ext in Windows
            ;; (should be e.g. in PHP directory's "ext" subdir)
            ;; [backslash UNDER WINDOWS, / under UNIX-like operating systems]  
            zend_extension = "<path to your XDebug>\php_xdebug-2.2.3-5.3-vc9-nts.dll"  
            
            ;; HERE comes the answer to your question, we set the mentioned variable to 10  
            xdebug.var_display_max_depth = 10
            


        Simple as that... you can check the results in phpinfo's xdebug part in a table: there will be a "Local value" and a "Master value" column.

        Here's a sample screenshot from my localhost server; in this example, the global configuration is 3, but I set the local value to 10, with the above mentioned ini_set():

        这篇关于为 xdebug 增加 var_display_max_depth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆