1

I'm doing some changes on a website hosted on a managed dedicated server from Hetzner and I found that somehow some php flags set in .htaccess are passed to PHP running as fastCGI. As far as I was aware, fastCGI/FPM flags need to be set in php.ini, so I'm confused and would like to understand how this trickery works. Unfortunately I have restricted access to the server, so I cannot see the apache setup.

For example, the .htaccess file has the following configuration (without being wrapped in an IfModule conditional).

php_value memory_limit 256M
php_flag  log_errors on
php_value error_log  /usr/home/shedrub/php_error.log

And when I run a php page with phpinfo() I get:

Server API:     CGI/FastCGI

Directive       Local Value                  Master Value
memory_limit    96M                          96M
log_errors      On                           Off 
error_log       /[redacted]/php_error.log    no value

A couple of interesting points:

  • The memory_limit flag is not passed or cannot be passed.
  • If I wrap the block in .htaccess with <IfModule mod_php5.c>, the values are still passed to the php process.
  • If I change one of the values in .htaccess, it takes a couple of minutes for it to appear in phpinfo. I reckon this is because an old process is still handling requests.

So it feels like this works like a mix of an apache module and fastCGI. Any ideas how this is possible? Or am I missing something about how fastCGI works in apache?

Augusto
  • 215
  • 1
  • 9
  • "fastCGI/FPM flags need to be set in php.ini" - or in [per-directory `.user.ini` files](http://php.net/manual/en/configuration.file.per-user.php). Just to confirm, the `error_log` setting reported by `phpinfo()` is the same as the directive? (You've "redacted" one and not the other?) "If I change one of the values in .htaccess" - what settings specifically? Try wrapping in `` - are they still passed? – MrWhite Mar 19 '19 at 12:51
  • 1
    Hi @MrWhite. There are no local `.user.ini` files in the website, and the values set in `.htaccess` do show up in `phpinfo()` (not all of them, but 2 log values show, but the memory_limit does not). And if I wrap with an ``, the value is not passed to PHP. It's weird! – Augusto Mar 19 '19 at 13:07

0 Answers0