How to specify FastCGI parameters with Apache mod_proxy_fcgi

apache-2.4php-fpm

The PHP-FPM documentation says that it's possible to pass custom php directives from the web server, and there's an example for Nginx.

Is it possible, and how, to do the same using Apache-2.4 and mod_proxy_fcgi?

As an example, I'd like to set a different open_basedir for different virtual hosts – all running under the same PHP-FPM pool.

Best Answer

Starting from Apache 2.4.26 you can use ProxyFCGISetEnvIf in the virtual host:

ProxyFCGISetEnvIf "true" PHP_ADMIN_VALUE "open_basedir=/home/user1:/tmp"