Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: File download or strange text in IE or Opera browsers  (Read 16464 times)

0 Members and 1 Guest are viewing this topic.

DJMaze

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Posts: 831
    • Dragonfly CMS
File download or strange text in IE or Opera browsers
« on: November 10, 2003, 07:40:09 pm »

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

  • Coppermine newbie
  • Offline Offline
  • Posts: 2
File download or strange text in IE or Opera browsers
« Reply #1 on: November 25, 2003, 09:49:28 pm »

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.
http://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??
Logged

DJAxion

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
    • http://the-expansion.com
File download or strange text in IE or Opera browsers
« Reply #2 on: December 01, 2003, 08:19:33 am »

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

DJAxion

  • Coppermine newbie
  • Offline Offline
  • Posts: 8
    • http://the-expansion.com
File download or strange text in IE or Opera browsers
« Reply #3 on: December 02, 2003, 11:09:38 pm »

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

In mainfile.php:
edit
Code: [Select]
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

Code: [Select]
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 :?:
Logged
Pages: [1]   Go Up
 

Page created in 0.023 seconds with 19 queries.