Skip to content

Commit

Permalink
Fixed nginx buffering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturSierzant committed Jun 7, 2019
1 parent 4261380 commit 5806095
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions include/initialize.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@
// +------------------------------------------------------------------------+
error_reporting(E_ALL ^ E_NOTICE);
@ini_set('display_errors', 0);
if ($cfg['testing'] == 'on') {
@ini_set('display_errors', -1);
if (function_exists('opcache_reset') == true) {
opcache_reset();
}
}

//prevent buffering for nginx
header('X-Accel-Buffering: no');

define('NJB_START_TIME', microtime(true));

Expand Down

3 comments on commit 5806095

@marcbth
Copy link

@marcbth marcbth commented on 5806095 Jun 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its work with

  • if ($cfg['testing'] == 'on') {

  •   @ini_set('display_errors', -1);
    
  •   if (function_exists('opcache_reset') == true) {
    
  •   	opcache_reset();
    
  •   }
    
  • }

    //prevent buffering for nginx
    header('X-Accel-Buffering: no');

@marcbth
Copy link

@marcbth marcbth commented on 5806095 Jun 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not delete line 34-39 otherwise an error 500

@ArturSierzant
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, I checked it once again on Apache and nginx. In my case all works ok, no error 500. To be honest this part of code didn't make sense in this place, because $cfg['testing'] was not defined yet...

Please sign in to comment.