File download or strange text in IE or Opera browsers File download or strange text in IE or Opera browsers
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

File download or strange text in IE or Opera browsers

Started by DJMaze, November 10, 2003, 07:40:09 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

DJMaze

This is caused when running an Apache 2.x server with PHP 4.3.3 or less.
Upgrade to PHP 4.3.4 if you use Apache 2 webserver.

This is caused by ob_flush() a command which is not properly translated to plain text in PHP to Apache 2.
So you get binary data instead of text output.
IE and Opera recognize the file as "binary" while it's actualy a text file.

If you don't believe me here is the bug post on php site:
http://bugs.php.net/bug.php?id=25701

NOTE: This bug isn't noticed in Mozilla and Netscape browsers.
There are 2 kinds of users in this world: satisfied and complainers.
Why do we never hear something from the satisfied users?
http://coppermine-gallery.net/forum/index.php?topic=24315.0

TheOne

Hmmm, the problem is still there, even when i have updated the phpserver to version 4.3.4.

You can see on this url, that it is 4.3.4.
//www.gmc.christiannissen.dk/analyze.php

You can also see the binary output on this page.
http://www.gmc.christiannissen.dk/modules.php?name=coppermine

I am running apache 1.3... and 2....


Any ideas??

DJAxion

Having the same problem as above: apache 2, php 4.3.4. Any solutions?

DJAxion

I found something that worked for me:
(Apache2, php 4.3.4)

In mainfile.php:
edit
if ($phpver >= '4.0.4pl1' && strstr($HTTP_USER_AGENT,'compatible')) {
    if (extension_loaded('zlib')) {
        ob_end_clean();
        ob_start('ob_gzhandler');
    }
} else if ($phpver > '4.0') {
    if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
        if (extension_loaded('zlib')) {
            $do_gzip_compress = TRUE;
            ob_start();
            ob_implicit_flush(0);
            //header('Content-Encoding: gzip');
        }
    }
}


in

if ($phpver > '4.0') {
    if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip')) {
        if (extension_loaded('zlib')) {
            $do_gzip_compress = TRUE;
            ob_start();
            ob_implicit_flush(0);
            //header('Content-Encoding: gzip');
        }
    }
}


It may not be the best solution, but it works for me, any thoughts about this :?: