Trying to override XDEBUG.INI options through Website PHP Options but not working properly

Discussion in 'Installation/Configuration' started by cjsdfw, Sep 3, 2024.

  1. cjsdfw

    cjsdfw Member

    Hi,I installed XDEBUG extendion for PHP 8.1 and configure the site to use PHP-FPM, then I configured the xdebug.ini file for PHP 8.1: /etc/php/8.1/fpm/conf.d/20-xdebug.ini as follows:
    zend_extension=xdebug.so
    xdebug.mode = off
    xdebug.client_host = 0.0.0.0
    xdebug.connect_timeout_ms = 500
    xdebug.log = "/var/log/xdebug.log"
    xdebug.log_level=2
    xdebug.start_with_request = yes​

    With the intent of overriding some parameters in a specific website running PHP 8.1 within the Website Configuration PHP Options like so for example:
    xdebug.mode = debug
    xdebug.connect_timeout_ms = 200​
    The problem is although the xdebug parameters are overriden as shown by xdebug_info() and phpinfo() functions, XDEBUG Features are not toggled as they should be.
    In this case I am trying to switch the Step Debugger "ON" from the default 'OFF' set in /etc/php/8.1/fpm/conf.d/20-xdebug.ini but for some reason although the xdebug.mode parameter changes, the Step Debugger feature does not get enabled. I have to switch it in /etc/php/8.1/fpm/conf.d/20-xdebug.ini for it get enabled.

    Is there a way to make this work through PHP Options or must I really make the changes in the /etc/php/8.1/fpm/conf.d/20-xdebug.ini file?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    It might be that xdebug settings can not be overridden in the pool file. You should ask the xdebug developers if these settings are overridable. As you can see, the changes in phpinfo, you know that they were written by ISPConfig correctly onto the pool file.
     
  3. cjsdfw

    cjsdfw Member

    In case some else stumbles onto this issue, per XDEBUG documentation:
    https://xdebug.org/docs/all_settings#xdebug.mode
    This setting can only be set in php.ini or files like 99-xdebug.ini that are read when a PHP process starts (directly, or through php-fpm). You can not set this value in .htaccess and .user.ini files, which are read per-request, nor through php_admin_value as used in Apache VHOSTs and PHP-FPM pools.
     
    ahrasis and till like this.

Share This Page