Setting up xDebug with PHPStorm and DevKinsta on Windows

I’ve followed the guide posted by philippstracker on this link: Guide: How to set up Xdebug (on DevKinsta) with PhpStorm

However, I couldn’t get it to establish conneciton.

When I run php -v inside devkinsta_fpm container I get:

PHP 7.4.18 (cli) (built: May 3 2021 11:27:06) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.18, Copyright (c), by Zend Technologies
with Xdebug v3.0.4, Copyright (c) 2002-2021, by Derick Rethans

But in settings of CLI-interpreter it says Debugger: Not Installed

My php ini from /etc/php/7.4/cli/ini.php has:

[xdebug]
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.discover_client_host = 1
xdebug.remote_host=host.docker.internal
xdebug.remote_port=9003

as well as php.ini ini /etc/php/7.4/fpm/

My /etc/php/7.4/fpm/conf.d has 20-xdebug.ini looking like this:

zend_extension = xdebug.so
xdebug.mode = develop,debug
xdebug.start_with_request=yes
xdebug.client_port=9003
xdebug.client_host=host.docker.internal
xdebug.log=/www/kinsta/logs/xdebug.log

Also, I’m pretty sure I’ve set up the path mappings correctly to the root of my local kinsta website:

However this is what the validation from debug returns:

Any help would be very much appreciated!

Hey @Ognjen_Babic :slight_smile: Glad you came across my guide here.

From what I can see, you’re almost right. However, you use a mix of Xdebug v2 and v3 settings in your FPM ini file (the CLI ini looks right)

The following options might work:

zend_extension = xdebug.so
xdebug.mode = develop,debug
xdebug.start_with_request = yes
xdebug.discover_client_host = 1
xdebug.client_host = host.docker.internal
xdebug.client_port = 9003

(the last 2 lines changed)

After that, please restart the docker container to apply the changes to all php services:

docker restart devkinsta_fpm

1 Like