当我的 php.php 启用 xdebug 模式时,所有作为 var_dump 的输出结构都会变成彩色(红色、绿色)。
如何在没有 xdebug 模式的情况下启用此颜色?
最佳答案
每个设置都在Xdebug settings page上.
这就是您所需要的:
xdebug.cli_color = 2
xdebug.cli_color Type: integer, Default value: 0, Introduced in Xdebug > 2.2 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.
更新
遗憾的是,xDebug 引用的链接上不再有 ANSICON。您可以从here下载.
警告:对我来说,Comodo Internet Security 已将 .dll 文件标记为病毒,因此请留意它。
关于php - 如何在 xdebug 模式下启用输出突出显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37182282/