PHP-FPM, .htaccess Configuration
Hi All
WHM CLOUDLINUX 7.5 xen enterprise hvm v74.0.6
Running PHP 7.2 with PHP-FPM.
Using .htaccess and .htpasswd to restrict site access for test environment.
Using SETENVIF to allow specific URI to be accessed for backend operations while the front end is not public.
The configuration works well if PHP-FPM is turned off and FAILS with PHP-FPM turned on.
I am looking at the configuration of PHP-FPM and suspect that the issue is with the ENV settings not being recognised / passed through to PHP-FPM.
This implies that I need to use the 'clear_env = no' setting for PHP-FPM while the default (assumed to be in absence of an explicit setting) is Yes.
This link
-
Hi @thowden I think the resource here might be useful for you Tutorial - Managing php.ini directives with PHP-FPM Can you let me know if that helps? Thanks! 0 -
Hi Lauren Thanks for the reference. I think it covers everything I was doing yesterday. The question relates to something that is not a php.ini directive but a PHP-FPM directive. Checking the PHP Manual: [QUOTE] FPM uses php.ini syntax for its configuration file - php-fpm.conf, and pool configuration files clear_env Tutorial - Managing php.ini directives with PHP-FPM 0 -
Hi @thowden You mentioned: [QUOTE]This link PHP: Configuration - Manual - I'm opening a documentation case for this. Also I want to point out I think you're looking in the wrong place for the change. The change goes into: /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml
but is reflected in:/opt/cpanel/ea-phpXX/root/etc/php-fpm.d/domain.tld.conf
it is not reflected in/var/cpanel/userdata/account/website.domain.php-fpm.yaml
this is where you make domain specific changes When I add clear_env: no in/var/cpanel/ApachePHPFPM/system_pool_defaults.yaml
and rebuild/restart php-fpm and apache I see the following in/opt/cpanel/ea-phpXX/root/etc/php-fpm.d/domain.tld.conf
grep clear_env /opt/cpanel/ea-php71/root/etc/php-fpm.d/mydomain.tld.conf clear_env = no0
Please sign in to leave a comment.
Comments
3 comments