"sendmail_path" setup using ".user.ini" files is failed (php-fpm)

I use PHP 7.3:

PHP Version 7.3.11-1+ubuntu18.04.1+deb.sury.org+1
Server API  FPM/FastCGI

and I need to have different sendmail configurations for different virtual hosts (applications).

I try to use .user.ini file to configure PHP parameters:

sendmail_from="user@domain.com"
sendmail_path="/usr/bin/agent -c profile1"

First parameter is overridden, but second one isn't: enter image description here

How can I configure different sendmail_path parameters for different virtualhosts/apps if I use PHP-FPM?

1 answer

  • answered 2019-11-07 14:16 mario

    The sendmail_path is a PHP_INI_SYSTEM class setting, and a php_admin_value[] in the FPM pool configuration.
    Whereas sendmail_from is a standard PHP_INI_ALL option.

    Thus you can't override the sendmail binary setting on a .user.ini / directory basis, nor per ini_set().