Page 1 of 2

implicit flushing

Posted: Thu Mar 13, 2008 7:56 pm
by tecktalkcm0391
I am confused on what exactly ob_implicit_flush does... any help?

Re: implicit flushing

Posted: Thu Mar 13, 2008 9:57 pm
by Christopher
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.

Re: implicit flushing

Posted: Sat Mar 15, 2008 11:27 am
by tecktalkcm0391
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?

Re: implicit flushing

Posted: Thu Mar 20, 2008 10:31 pm
by tecktalkcm0391
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

Re: implicit flushing

Posted: Fri Mar 21, 2008 2:56 am
by Chris Corbyn
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
Wrong directive isn't it?

Code: Select all

php_value implicit_flush On
There's no "ing".

Re: implicit flushing

Posted: Fri Mar 21, 2008 11:02 pm
by tecktalkcm0391
i am still getting an internal error (500) with my .htaccess file looking like this:

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]
 
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....

Re: implicit flushing

Posted: Fri Mar 21, 2008 11:44 pm
by Chris Corbyn
tecktalkcm0391 wrote:but when i do php info it says under commands --without-apache... if that has anything to do with it....
It does. PHP is not compiled as an apache module so apache can't control it. It must be running as CGI I assume.

Re: implicit flushing

Posted: Sat Mar 22, 2008 12:06 am
by tecktalkcm0391
oh ok... can I add it as a mod somehow?

Re: implicit flushing

Posted: Sat Mar 22, 2008 12:17 am
by Chris Corbyn
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.

Re: implicit flushing

Posted: Sat Mar 22, 2008 12:18 am
by tecktalkcm0391
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.

Re: implicit flushing

Posted: Sat Mar 22, 2008 12:21 am
by Chris Corbyn
tecktalkcm0391 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.
Cool, so you should be able to just modify implicit_flush in php.ini instead ;)

Re: implicit flushing

Posted: Sat Mar 22, 2008 12:23 am
by tecktalkcm0391
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.

Re: implicit flushing

Posted: Sat Mar 22, 2008 12:38 am
by tecktalkcm0391
actually i can run command line commands if i need to do that to install the module

Re: implicit flushing

Posted: Sat Mar 22, 2008 1:20 am
by Chris Corbyn
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?

Re: implicit flushing

Posted: Sat Mar 22, 2008 10:34 am
by tecktalkcm0391
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. :banghead: