|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2018-01-08 03:30 UTC] shestero at meta dot ua
[2018-01-09 14:37 UTC] mike@php.net
-Status: Open
+Status: Verified
[2018-01-09 14:37 UTC] mike@php.net
[2018-01-10 02:08 UTC] shestero at meta dot ua
[2018-01-10 02:09 UTC] shestero at meta dot ua
[2021-02-15 14:08 UTC] cmb@php.net
-Package: *Compression related
+Package: Streams related
[2021-02-15 14:08 UTC] cmb@php.net
[2021-02-16 18:02 UTC] cmb@php.net
-Summary: compression filters on stdout not working any
more
+Summary: Flushing streams with compression filter is
broken
-Assigned To:
+Assigned To: cmb
[2021-02-16 18:02 UTC] cmb@php.net
[2021-02-16 18:45 UTC] cmb@php.net
[2021-02-22 14:35 UTC] cmb@php.net
[2021-02-22 14:35 UTC] cmb@php.net
-Status: Verified
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 14:00:01 2025 UTC |
Description: ------------ I used this way to produce compressed output for years but now it return zero-output without any errors anywhere. Registered Stream Filters: zlib.*, bzip2.*, convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk My configure parameters: './configure' '--with-openssl' '--with-ssl=/usr/bin/openssl' '--with-ssl-lib=/usr/lib/x86_64-linux-gnu' '--with-libdir=lib/x86_64-linux-gnu' '--with-bz2' '--enable-exif' '--with-gd' '--with-mcrypt' '--with-mysql' '--with-mysql-sock' '--enable-sockets' '--enable-zip' '--with-apxs2=/usr/bin/apxs2' '--with-config-file-path=/var/lib/apache2/conf' '--with-jpeg-dir' '--enable-gd-native-ttf' '--with-xmlrpc' '--with-freetype-dir' '--with-zlib' '--with-zlib-dir' '--enable-maintainer-zts' '--with-tsrm-pthreads' '--with-mysqli' '--enable-mbstring' '--with-pdo-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-curl' '--enable-memcache' PS Output mute as I adding compression filters. string.toupper and string.tolower work! Test script: --------------- error_reporting(E_ALL); ini_set("display_errors", 1); if (true) { header("Content-Description: File Transfer"); header("Content-Disposition: attachment; filename=main.csv.bz2"); header("Content-Type: application/x-bzip2"); header("Content-Transfer-Encoding: binary"); } else { header("Content-Type: application/csv"); header("Content-Disposition: attachment;Filename=main.csv"); } $bz = fopen('php://output', 'w'); fwrite($bz,"sdfgdfg"); // output such way ... fflush($bz); fclose($bz); stream_filter_append($bz, 'convert.iconv.UTF-8/CP1251//TRANSLIT'); // ok if (true) { $param = array('blocks' => 6, 'work' => 0); // for bzip2 $ok = stream_filter_append($bz, 'bzip2.compress', STREAM_FILTER_WRITE, $param); // $param = array('level' => 6, 'window' => 15, 'memory' => 9); // for gzip //$ok = stream_filter_append($bz, 'zlib.deflate');//, STREAM_FILTER_WRITE, $param); if ($ok===false) { die("Cannot stream_filter_append( 'bzip2.compress' ) !"); } } Expected result: ---------------- error or some output as usual Actual result: -------------- browser saves zero-size file.