Breaking News
Loading...
Saturday, August 10, 2013

Turn Off or Disable Output Buffering for php.ini on PHP 5.3.2 on Linux CentOS 6.4

2:52 PM

1. Introduction
Output buffering is used by PHP to improve performance and to perform a few tricks. PHP will send buffer to browser every get_opt(‘output_buffering’) bytes. Turning on output buffering alone decreases the amount of time it takes to download and render our HTML because it’s not being sent to the browser in pieces as PHP processes the HTML. In this post, i will show how turn off or disable output buffering for php.ini on PHP 5.3.2. This steps has been tested on the Red Hat Linux Enterprise 6 (RHEL 6) server
2. Disable Output Buffering
Step 1. Open /etc/php.ini :
[root@rhel6 ~]# vi /etc/php.ini
In PHP 5.3.2, output_buffering’s directive is set to ‘enabled’ or ‘On’ with buffer size 4096 by default. It’s on line 264 on /etc/php.ini file :
; http://www.php.net/manual/en/outcontrol.configuration.php#ini.output-buffering
output_buffering = 4096
Step 2. In order to disable or turn it ‘off’, you have to comment out the line 264 as below :
; http://www.php.net/manual/en/outcontrol.configuration.php#ini.output-buffering
;output_buffering = 4096
Step 3. Don’t forget to restart httpd service to take effect immediately :
[root@rhel6 ~]# service httpd restart
Stopping httpd:                                            [  OK  ]
Starting httpd:                                            [  OK  ]

0 comments:

Post a Comment

 
Toggle Footer