implicit flushing
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
implicit flushing
I am confused on what exactly ob_implicit_flush does... any help?
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: implicit flushing
As I recall, flushing is set Off by default. So when you echo it is put in the output buffer and the output buffer is sent when the script ends. If you turn implicit_flush On the every echo is sent to the browser immediately. The function ob_implicit_flush() allows you to set the flag to On or Off.
(#10850)
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Re: implicit flushing
So pretty much that is a way to make the page start to download on the client-side while PHP is still processing what HTML to send?
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Re: implicit flushing
I am having trouble getting the implicit flushing to be site wide via .htaccess file.. i have the following but it gives an internal error on the whole site:
Code: Select all
php_value implicit_flushing On- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: implicit flushing
Wrong directive isn't it?tecktalkcm0391 wrote:I am having trouble getting the implicit flushing to be site wide via .htaccess file.. i have the following but it gives an internal error on the whole site:
Code: Select all
php_value implicit_flushing On
Code: Select all
php_value implicit_flush On- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Re: implicit flushing
i am still getting an internal error (500) with my .htaccess file looking like this:
and the APACHE Engine, is one, but when i do php info it says under commands --without-apache... if that has anything to do with it....
Code: Select all
php_value implicit_flush On
RewriteEngine On
RewriteBase /
# remove the www
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# remove index file access
RewriteRule ^index\.(php|html|htm) http://SITE.com/ [R=301,L]
# remove .php; use THE_REQUEST to prevent infinite loops
RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP
RewriteRule (.*)\.php$ $1 [R=301]
# remove index
RewriteRule (.*)/index$ $1/ [R=301]
# remove slash if not directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*)/ $1 [R=301]
# add .php to access file, but don't redirect
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: implicit flushing
It does. PHP is not compiled as an apache module so apache can't control it. It must be running as CGI I assume.tecktalkcm0391 wrote:but when i do php info it says under commands --without-apache... if that has anything to do with it....
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Re: implicit flushing
oh ok... can I add it as a mod somehow?
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: implicit flushing
Did you install apache and PHP or did someone else? All you need to do is build PHP "--with-apxs2" or "--with-apache2"
If you didn't install it then you'll need control over php.ini.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Re: implicit flushing
hosting company did, but i have access to php.ini and all files on my part of the server, just not like the server config.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: implicit flushing
Cool, so you should be able to just modify implicit_flush in php.ini insteadtecktalkcm0391 wrote:hosting company did, but i have access to php.ini and all files on my part of the server, just not like the server config.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Re: implicit flushing
ok. well what about auto_append_files, but i really only want it for one domain, and like 3 are hosting on the same account...
i guess no way to just add the mod to the config. you'd have to recompile the whole apache server.
i guess no way to just add the mod to the config. you'd have to recompile the whole apache server.
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Re: implicit flushing
actually i can run command line commands if i need to do that to install the module
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: implicit flushing
You won't be able to install an apache module unfortunately. It sounds like you just need to have a common include() on all pages which starts ob_implicit_flush(). How are your pages laid out? Do they all go via a central file which includes other pages or are they all in separate files?
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Re: implicit flushing
they are all in separate files, and I was going to use auto_prepend_file to get the same includes on the pages, but I can't do that, so I guess I just need to copy and paste a code to the top of every page. 