Remote Docker interpreter: Xdebug is not available

Hello. I have problem with remote debug in PhpStorm. When I setup connection to remote interpreter in Docker container, Phpstorm does not found xdebug extension, which is enabled and available in CLI and FPM modes.

Remote debug of FPM in this container works fine, but when I try to start any command-line script in container, interpreter says, that in can not load Xdebug extensionBut this extension exists and available in CLI:

$ docker exec -it docker_webapp_1 php -v
PHP 7.2.7-0ubuntu0.18.04.2 (cli) (built: Jul  4 2018 16:55:24) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
   with Zend OPcache v7.2.7-0ubuntu0.18.04.2, Copyright (c) 1999-2018, by Zend Technologies
   with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

What I'm doing wrong?

List of additional ini files in contailer:

[email protected]:/etc/php/7.2/cli/conf.d# ls
10-mysqlnd.ini   20-fileinfo.ini   20-phar.ini       20-sysvshm.ini
10-opcache.ini   20-ftp.ini        20-posix.ini      20-tokenizer.ini
10-pdo.ini       20-gettext.ini    20-protobuf.ini   20-wddx.ini
15-xml.ini       20-grpc.ini       20-readline.ini   20-xdebug.ini
20-calendar.ini  20-iconv.ini      20-shmop.ini      20-xmlreader.ini
20-ctype.ini     20-json.ini       20-simplexml.ini  20-xmlwriter.ini
20-curl.ini      20-mbstring.ini   20-sockets.ini    20-xsl.ini
20-dom.ini       20-mysqli.ini     20-sysvmsg.ini    20-zip.ini
20-exif.ini      20-pdo_mysql.ini  20-sysvsem.ini

IDE sees all files, except 20-xdebug.ini 

PHP version: 7.2.7-0ubuntu0.18.04.2


PHP CLI: /usr/bin/php7.2 PHP CGI: Not Installed (php-cgi sapi is necessary to use built-in web server)


Loaded Configuration File: /etc/php/7.2/cli/php.ini


Additional .ini files parsed: /etc/php/7.2/cli/conf.d/10-mysqlnd.ini

/etc/php/7.2/cli/conf.d/10-opcache.ini /etc/php/7.2/cli/conf.d/10-pdo.ini

/etc/php/7.2/cli/conf.d/15-xml.ini /etc/php/7.2/cli/conf.d/20-calendar.ini

/etc/php/7.2/cli/conf.d/20-ctype.ini /etc/php/7.2/cli/conf.d/20-curl.ini

/etc/php/7.2/cli/conf.d/20-dom.ini /etc/php/7.2/cli/conf.d/20-exif.ini

/etc/php/7.2/cli/conf.d/20-fileinfo.ini /etc/php/7.2/cli/conf.d/20-ftp.ini

/etc/php/7.2/cli/conf.d/20-gettext.ini /etc/php/7.2/cli/conf.d/20-grpc.ini

/etc/php/7.2/cli/conf.d/20-iconv.ini /etc/php/7.2/cli/conf.d/20-json.ini

/etc/php/7.2/cli/conf.d/20-mbstring.ini /etc/php/7.2/cli/conf.d/20-mysqli.ini

/etc/php/7.2/cli/conf.d/20-pdo_mysql.ini /etc/php/7.2/cli/conf.d/20-phar.ini

/etc/php/7.2/cli/conf.d/20-posix.ini /etc/php/7.2/cli/conf.d/20-protobuf.ini

/etc/php/7.2/cli/conf.d/20-readline.ini /etc/php/7.2/cli/conf.d/20-shmop.ini

/etc/php/7.2/cli/conf.d/20-simplexml.ini /etc/php/7.2/cli/conf.d/20-sockets.ini

/etc/php/7.2/cli/conf.d/20-sysvmsg.ini /etc/php/7.2/cli/conf.d/20-sysvsem.ini

/etc/php/7.2/cli/conf.d/20-sysvshm.ini /etc/php/7.2/cli/conf.d/20-tokenizer.ini

/etc/php/7.2/cli/conf.d/20-wddx.ini /etc/php/7.2/cli/conf.d/20-xmlreader.ini

/etc/php/7.2/cli/conf.d/20-xmlwriter.ini /etc/php/7.2/cli/conf.d/20-xsl.ini

/etc/php/7.2/cli/conf.d/20-zip.ini

Debugger extension: Not Found

2 comments

Hi there,

Try with Debugger extension" field empty.

 

Based on what you have provided (your "docker exec -it docker_webapp_1 php -v") you do not need to provide anything there since you have xdebug loaded by default. Right now it might be trying  to load it for the 2nd time. Double check the help page to see what that field does and when it can be used.

 

As to why xdebug config file is not listed as loaded -- no clue.

1

It's not the IDE that cannot see the extension - I am sure that if you will run that command (docker://docker_webapp:latest/php -dzend... etc), result will be the same.

Are permissions for 20-xdebug.ini file same when compared to others?
Is path to xdebug.so correct? Are permissions of xdebug.so fine as well?

0

Please sign in to leave a comment.