Xdebug in development environment

Struggling to get Xdebug working on Trellis development environment. Website is loading in Virtualbox in development environment and showing up in host machines browser. I’m using PHPstorm’s zero-configuration guide fro Xdebug. Since Trellis handles the installation of Xdebug on the server, I didn’t bother with this part. I installed the chrome extension and set the IDE Key to XDEBUG. I changed the following options in /roles/xdebug/defaults/main.yml

xdebug_mode: 'debug'
xdebug_start_with_request: 'true'

and re-provisioned using the --tags

I opened the website on the browser and turned the chrome debugger extension to Debug

PHPstorm debug validation outputs the following

How do I get Xdebug to work correctly? What am I missing here?

You shouldn’t need to do this since that’s the default in development: https://github.com/roots/trellis/blob/68cbc413587265c4b9500ea68563923185d64afe/group_vars/development/php.yml#L7-L9

Tangent: reminder to customize variables in group_vars instead of changing role default variables as well :smile:

Not sure if you saw https://discourse.roots.io/t/phpstorm-and-trellis/9962 but it might help.

Yeah, you’re right, I think I thought I had changed them, but didn’t lol. So, I think I’m getting close to solving my issue. I can see Xdebug is installed on the vagrant instance, because I created a xdebuginfo.php file in my /site/web/ directory with the following:

<?php
   xdebuginfo():
?>

Fetching the file in the browser, shows Xdebug 3.2.0 is installed and errors when trying to connect the debugger to the client.

So I think the issue is that my IDE cannot connect to Xdebug on my development instance. Inside PHPstorm’s settings, I do not have a CLI interpreter configured.

I configured a remote PHP Interpreter selecting Vagrant as the option and the Vagrant Instance Folder to be where my Vagrantfile is located in /trellis/

The PHP executable is configured: /usr/bin/php

However, the configuration .ini configuration file for Xdebug isn’t in the list:
/etc/php/8.0/cli/conf.d/10-mysqlnd.ini, /etc/php/8.0/cli/conf.d/10-opcache.ini, /etc/php/8.0/cli/conf.d/10-pdo.ini, /etc/php/8.0/cli/conf.d/15-xml.ini, /etc/php/8.0/cli/conf.d/20-bcmath.ini, /etc/php/8.0/cli/conf.d/20-calendar.ini, /etc/php/8.0/cli/conf.d/20-ctype.ini, /etc/php/8.0/cli/conf.d/20-curl.ini, /etc/php/8.0/cli/conf.d/20-dom.ini, /etc/php/8.0/cli/conf.d/20-exif.ini, /etc/php/8.0/cli/conf.d/20-ffi.ini, /etc/php/8.0/cli/conf.d/20-fileinfo.ini, /etc/php/8.0/cli/conf.d/20-ftp.ini, /etc/php/8.0/cli/conf.d/20-gettext.ini, /etc/php/8.0/cli/conf.d/20-iconv.ini, /etc/php/8.0/cli/conf.d/20-igbinary.ini, /etc/php/8.0/cli/conf.d/20-imagick.ini, /etc/php/8.0/cli/conf.d/20-intl.ini, /etc/php/8.0/cli/conf.d/20-mbstring.ini, /etc/php/8.0/cli/conf.d/20-msgpack.ini, /etc/php/8.0/cli/conf.d/20-mysqli.ini, /etc/php/8.0/cli/conf.d/20-newrelic.ini, /etc/php/8.0/cli/conf.d/20-pdo_mysql.ini, /etc/php/8.0/cli/conf.d/20-phar.ini, /etc/php/8.0/cli/conf.d/20-posix.ini, /etc/php/8.0/cli/conf.d/20-readline.ini, /etc/php/8.0/cli/conf.d/20-shmop.ini, /etc/php/8.0/cli/conf.d/20-simplexml.ini, /etc/php/8.0/cli/conf.d/20-sockets.ini, /etc/php/8.0/cli/conf.d/20-sysvmsg.ini, /etc/php/8.0/cli/conf.d/20-sysvsem.ini, /etc/php/8.0/cli/conf.d/20-sysvshm.ini, /etc/php/8.0/cli/conf.d/20-tokenizer.ini, /etc/php/8.0/cli/conf.d/20-xmlreader.ini, /etc/php/8.0/cli/conf.d/20-xmlrpc.ini, /etc/php/8.0/cli/conf.d/20-xmlwriter.ini, /etc/php/8.0/cli/conf.d/20-xsl.ini, /etc/php/8.0/cli/conf.d/20-zip.ini, /etc/php/8.0/cli/conf.d/25-memcached.ini

The xdebug.ini file is located at /etc/php/0.8/fpm/conf.d/20-xdebug.ini
Is this the reason that the configuration shows Debugger: Not installed?

How do I get the xdebug.ini file to be included?

I shouldn’t add its entry into the php.ini because that’s all managed by ansible right?