First of all we need wsl2 ip address. To find out what’s the ip open windows powershell and run ipconfig
Under the Ethernet adapter vEthernet (WSL) look for the IPv4 Address Go to wsl2 and open your php.ini
e.g sudo nano /etc/php/7.x/apache2/php.ini
And paste these configurations zend_extension=”xdebug.so”
xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.client_host=paste-wsl-ip-address
xdebug.client_port=9001
xdebug.mode=debug,develop,profile
xdebug.cli_color=1
xdebug.start_with_request=trigger
xdebug.log_level=3
xdebug.idekey=PHPSTORM
xdebug.discover_client_host=false
xdebug.max_nesting_level=256
xdebug.log = /var/www/html/xdebug.log
xdebug.profiler_enable=On…