Friday, May 9, 2014

Adjustment of PHP output buffering in DSM

The HTTP server in DSM is by default configured to buffer and cache the output generated by PHP.

The caching can be disabled in /etc/php/conf.d/user-settings:
 opcache.enable = 0
 opcache.enable_cli = 0

The output buffering does not only take place in PHP but also in the mod_fastcgi module of Apache.

The settings for this module reside in /etc/httpd/conf/extra/mod_fastcgi.conf

Just change
  FastCgiExternalServer /php-fpm-handler [...] -idle-timeout 3600
to
  FastCgiExternalServer /php-fpm-handler [...]  -idle-timeout 3600 -flush

to disable caching if you want to be able to send e.g. status message already during the processeing of a PHP request.

No comments:

Post a Comment