Conditional Xdebug per website?

Discussion in 'Server Operation' started by Steveorevo, Apr 22, 2022.

  1. Steveorevo

    Steveorevo Member

    I'm running ISPConfig on Nginx. I see that its possible to run multiple versions of PHP-FPM (i.e. 7.2, 7.4, etc). This allows me to include Xdebug (which can inhibit performance but help in program development) on the PHP 7.2 stack, while keeping PHP 7.4 lean and mean and without Xdebug.

    I can even toggle Xdebug support on a per website basis. Cool!

    However, would it be possible to keep the same PHP 7.4 version while accomplishing this toggle task? I noticed that adding additional PHP versions requires telling ISPConfig their respective PHP-FPM folders (i.e /etc/php/7.2 and /etc/php/7.4). I tried simply copying /etc/php/7.4 to /etc/php/7.4-xdebug and including the (must have early binding) requirement but it looks like I'd have to modify PHP-FPM's socket folders too (to be unique), log filenames, and possibly their init.d startup scripts to have unique PID files. I tried but no luck. Has anyone tried this task or see other areas that could be preventing it from being possible? Or perhaps know of another way to accomplish this task?
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    That's not the case. by default, all PHP versions use the same socket folder and that's also the recommended setting, so you should not set a unique folder, this field in additional PHP settings should be kept empty.
  3. Steveorevo

    Steveorevo Member

    I was referring to the internal php-fpm.conf, at the bottom of the file (also located in the '7.4' folder) is:
    Doesn't each version, i.e. PHP 7.2, use its own unique path? i.e. /etc/php/7.2/fpm/pool.d, etc.
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    That's the pool directory and not the socket directory. The pool directory must be unique, while the socket directory does not has to be unique as each socket has a unique file name anyway and the socket directory is set within ISPConfig additional PHP config settings and this field should be left empty when configuring an additional PHP version.
    Steveorevo likes this.

Share This Page