In script PHP output buffer parameters are ignored by server

I tried to dump the output of certain scripts to the browser on demand, but they do not work on our production server.

For example, I tried running the “Phoca Deck Modification Tool” (find it on Google), and I don’t see any output until the script completes.

I tried to immediately clear the buffer on another script that works fine on any server, but using the following code:

echo "something"; ob_flush(); flush(); 

Setting "ob_implicit_flush (1);" Does not help.

Apache 2.2.21 server running PHP 5.2.17 runs on Linux. You can see our php.ini file here if this helps: http://www.smallfiles.org/download/1123/php.ini.html

This is not the only problem that the server faces ignoring script directives. The server also ignores timeout encoding, for example:

 ini_set('max_execution_time', 900*60); 

and

 set_time_limit(86400); 

Script is always disabled by default php.ini.

It doesn't seem to matter if the script is executed in IE or Firefox.

+4
source share
2 answers

Solved this secret. Both of them.

To fix the output buffer problem, I needed to disable gzip compression in the .htaccess file, although I would like to just do it in a script.

Here is what you should put in your .htaccess file:

 <IfModule mod_gzip.c> mod_gzip_on No </IfModule> SetEnv no-gzip dont-vary 

To fix the script completion without errors, I checked the Apache log files and found that it was not PHP, but in the Apache configuration: The specified timeout expired: ap_content_length_filter: apr_bucket_read () failed

I had to increase the Apache timeout so that this error would not look like my scripts were failing. Enabling KeepAlive in Apache also helped solve the problem once and for all.

Hope this helps someone and thanks for helping all elses!

+1
source

You may have downloaded the wrong php.ini file as it tends to change based on the directory.

To check the downloaded php.ini , write: echo php_ini_loaded_file(); which will provide you with the directory in which it is located. see php.net

if this fails, see serverfault.com for the server's stackexchange site.

0
source

All Articles