Xdebug configurations for Xdebug2 and Xdebug3 under Windows and Linux

In your xdebug.ini file:

; For Xdebug 2 (2.5.5) / Linux
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9003
xdebug.remote_host=172.17.0.1
; For Xdebug 2 (2.5.5) / Windows
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9003
xdebug.remote_host=172.17.0.1
; For Xdebug 3 (3.1.1) / Linux
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so
xdebug.mode=debug
xdebug.discover_client_host=no
xdebug.client_port=9003
xdebug.client_host=172.17.0.1
; For Xdebug 3 (3.1.1) / Windows
zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so
xdebug.mode=debug
xdebug.discover_client_host=no
xdebug.client_port=9003
xdebug.client_host=host.docker.internal

Colors in PHP CLI

Test in console:

php -r 'echo "\033[31mTEST\0330m'

Test in php file:

echo "\033[32mTEST\033[0m" . PHP_EOL;

Remember to use quotation mark instead of apostrophe.

You can set foreground and background colors.

Color codes:

FG codeBG codeColor
3040Black
3141Red
3242Green
3343Yellow
3444Blue
3545Magenta
3646Cyan
3747White
90100Bright Black (Gray)
91101Bright Red
92102Bright Green
93103Bright Yellow
94104Bright Blue
95105Bright Magenta
96106Bright Cyan
97107Bright White