0
votes

Previously, I was using Xdebug connected to my PhpStorm and my local servers was using the apache2 PHP library. But now, I need to use php-fpm to have multiple version of PHP running on the same server, so I installed it.

I got it working fine but when I tried to use my PhpStorm to debug things, nothing happens, I restarted all connections/processes and nothing more... I only need Xdebug for one version of PHP (PHP 7.4). I am also using PHP 5.6 for PhpMyAdmin but every others versions are not in use.

  • Apache2 connects to FPM using a socket file.
  • I checked PhpStorm is listening.
  • Nothing listens the port 9000, no result to lsof -i -P -n | grep :9000
  • phpinfo() shows that Xdebug is loaded:

This program makes use of the Zend Scripting Language Engine: Zend
Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.1, Copyright (c), by Zend Technologies
with Xdebug v2.8.0beta2, Copyright (c) 2002-2019, by Derick Rethans

Here is the configuration of Xdebug:

zend_extension = xdebug.so
xdebug.remote_enable = true
xdebug.remote_connect_back = false
xdebug.remote_host = [MY HOST IP]
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM

Everything seems up-to-date :

  • OS: Ubuntu 18.04.3 LTS
  • Apache2 : 2.4.29-1ubuntu4.11
  • php-xdebug : 2.9.0+2.5.5-1+ubuntu18.04.1+deb.sury.org+1
  • php-fpm: 2:7.4+71+ubuntu18.04.1+deb.sury.org+1

Is there any known issue using Xdebug with php-fpm?

1

1 Answers

0
votes

In fact, I forgot that my configuration was under the apache2 folder of /etc/php/7.4 but I should have used /etc/php/7.4/fpm/conf.d to put my own configuration.
I fixed it, I restarted php-fpm using service php7.4-fpm restart and this is ok !

Using FPM with PHP 7.4, the right configuration folder is /etc/php/7.4/fpm/conf.d and NOT /etc/php/7.4/apache2/conf.d !