Laravel development with xdebug 3

Development env background

Laravel 8.x based on php 7.4 + xdebug 3.0.3 fpm with nginx, running in docker container. PHPstrorm as IDE.

php.ini config

[xdebug]
;;;;; xdebug 3.0.3
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.idekey=PHPSTORM
xdebug.remote_handler=dbgp

; xdebug 2 remote_autostart setting has been removed. Instead, set start_with_request in xdebug 3
xdebug.start_with_request=yes

; xdebug 2 remote_connect_back replaced by discover_client_host in xdebug 3
xdebug.discover_client_host=1

; xdebug 2 remote_port replaced by client_port in xdebug 3
xdebug.client_port=9003

; xdebug 2 remote_log_level replaced by log_level in xdebug 3
xdebug.log_level = 0

; windows or mac using host.docker.internal, linux using 127.0.0.1
xdebug.client_host=host.docker.internal

Tips

Use xdebug_info() rather than php_info(), in order to diagnose why xdebug not working.;

<?php

xdebug_info();