php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22789 echo/print/flush doesn't work while socket open
Submitted: 2003-03-19 11:27 UTC Modified: 2003-03-24 04:21 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:-1 (-100.0%)
From: dietrich dot ayala at foundstone dot com Assigned:
Status: No Feedback Package: CGI/CLI related
PHP Version: 4.3.0 OS: windows 2000
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: dietrich dot ayala at foundstone dot com
New email:
PHP Version: OS:

 

 [2003-03-19 11:27 UTC] dietrich dot ayala at foundstone dot com
In this example, php doesn't flush it's buffer until the after fclose(); I'm testing w/ a 10mb text file.

<?php

if (($f = fopen($very_large_file, 'r')) != 0) {

  while ( !feof($f) ) {

    echo fread($f, 4096);
    flush();
  }

  fclose($f);

}
?>

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-19 11:36 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-STABLE-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-STABLE-latest.zip


If the problem persists, please give more information
of your environment, like are you running this under CGI/CLI/IIS/Apache/etc. ?

 [2003-03-19 11:39 UTC] pollita@php.net
Also describe your file (does it contain lin breaks? are they DOS line breaks {\r\n}, unix line breaks {\n}, or Mac line breaks {\r}), and output buffering conditions (The output of phpinfo(); would be most helpful).
 [2003-03-19 11:43 UTC] dietrich dot ayala at foundstone dot com
using CGI w/ IIS.
the file has DOS linebreaks.

phpinfo() output is below. thanks!

PHP Version 4.3.0

System Windows NT localhost 5.0 build 2195
Build Date Jan 7 2003 15:51:27
Server API CGI/FastCGI
Virtual Directory Support enabled
Configuration File (php.ini) Path D:\experience\php\php.ini
PHP API 20020918
PHP Extension 20020429
Zend Extension 20021010
Debug Build no
Thread Safety enabled
Registered PHP Streams php, http, ftp, https, ftps, compress.zlib

This program makes use of the Zend Scripting Language Engine:
Zend Engine v1.3.0, Copyright (c) 1998-2002 Zend Technologies with Zend Optimizer v2.1.0, Copyright (c) 1998-2003, by Zend Technologies

Configuration
PHP Core
Directive Local Value Master Value
allow_call_time_pass_reference On On
allow_url_fopen Off Off
always_populate_raw_post_data Off Off
arg_separator.input & &
arg_separator.output & &
asp_tags Off Off
auto_append_file no value no value
auto_prepend_file no value no value
browscap no value no value
default_charset no value no value
default_mimetype text/html text/html
define_syslog_variables Off Off
disable_functions no value no value
display_errors On On
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root http://www.php.net/ http://www.php.net/
enable_dl On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 2039 2039
expose_php Off Off
extension_dir ./extensions ./extensions
file_uploads Off Off
gpc_order GPC GPC
highlight.bg #FFFFFF #FFFFFF
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .;c:\php4\pear .;c:\php4\pear
log_errors Off Off
log_errors_max_len 1024 1024
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
max_execution_time 600 600
max_input_time 600 600
open_basedir no value no value
output_buffering no value no value
output_handler no value no value
post_max_size 32M 32M
precision 14 14
register_argc_argv On On
register_globals Off Off
report_memleaks On On
safe_mode Off Off
safe_mode_exec_dir no value no value
safe_mode_gid Off Off
safe_mode_include_dir no value no value
sendmail_from me@localhost.com me@localhost.com
sendmail_path no value no value
short_open_tag On On
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
track_errors On On
unserialize_callback_func no value no value
upload_max_filesize 2M 2M
upload_tmp_dir no value no value
user_dir no value no value
variables_order EGPCS EGPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
y2k_compliance Off Off

Zend Optimizer
Optimization Pass 1 enabled
Optimization Pass 2 enabled
Optimization Pass 3 enabled
Optimization Pass 9 disabled
Optimization Pass 10 disabled
Zend Loader enabled
License Path no value

bcmath
BCMath support enabled

calendar
Calendar support enabled

com
Directive Local Value Master Value
com.allow_dcom On On
com.autoregister_casesensitive On On
com.autoregister_typelib Off Off
com.autoregister_verbose Off Off
com.typelib_file no value no value

ctype
ctype functions enabled

domxml
DOM/XML enabled
DOM/XML API Version 20020814
libxml Version 20430
HTML Support enabled
XPath Support enabled
XPointer Support enabled
DOM/XSLT enabled
libxslt Version 1.0.23
libxslt compiled against libxml Version 2.4.28

ftp
FTP support enabled

gd
GD Support enabled
GD Version bundled (2.0 compatible)
FreeType Support enabled
FreeType Linkage with freetype
JPG Support enabled
PNG Support enabled
WBMP Support enabled

mssql
MSSQL Support enabled
Active Persistent Links 0
Active Links 0
Library version 7.0

Directive Local Value Master Value
mssql.allow_persistent On On
mssql.batchsize 0 0
mssql.compatability_mode Off Off
mssql.connect_timeout 5 5
mssql.datetimeconvert On On
mssql.max_links Unlimited Unlimited
mssql.max_persistent Unlimited Unlimited
mssql.max_procs 25 25
mssql.min_error_severity 10 10
mssql.min_message_severity 10 10
mssql.secure_connection Off Off
mssql.textlimit 100000 100000
mssql.textsize 100000 100000
mssql.timeout 60 60

mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 3.23.49

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout -1 -1
mysql.default_host no value no value
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

odbc
ODBC Support enabled
Active Persistent Links 0
Active Links 0
ODBC library Win32

Directive Local Value Master Value
odbc.allow_persistent On On
odbc.check_persistent On On
odbc.default_db no value no value
odbc.default_pw no value no value
odbc.default_user no value no value
odbc.defaultbinmode return as is return as is
odbc.defaultlrl return up to 4096 bytes return up to 4096 bytes
odbc.max_links Unlimited Unlimited
odbc.max_persistent Unlimited Unlimited

openssl
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.6g 9 Aug 2002

overload
User-Space Object Overloading Support enabled

pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 3.92 11-Sep-2002

session
Session Support enabled
Registered save handlers files user

Directive Local Value Master Value
session.auto_start Off Off
session.bug_compat_42 On On
session.bug_compat_warn On On
session.cache_expire 180 180
session.cache_limiter private, must-revalidate, pre-check=0, post-check=0 private, must-revalidate, pre-check=0, post-check=0
session.cookie_domain no value no value
session.cookie_lifetime 0 0
session.cookie_path / /
session.cookie_secure Off Off
session.entropy_file no value no value
session.entropy_length 0 0
session.gc_dividend 100 100
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1
session.name identity identity
session.referer_check no value no value
session.save_handler files files
session.save_path d:\experience\sessiondata d:\experience\sessiondata
session.serialize_handler php php
session.use_cookies Off Off
session.use_only_cookies Off Off
session.use_trans_sid On On

sockets
Sockets Support enabled

standard
Regex Library Bundled library enabled
Dynamic Library Support enabled
Internal Sendmail Support for Windows enabled

Directive Local Value Master Value
assert.active 1 1
assert.bail 0 0
assert.callback no value no value
assert.quiet_eval 0 0
assert.warning 1 1
auto_detect_line_endings 0 0
default_socket_timeout 60 60
safe_mode_allowed_env_vars PHP_ PHP_
safe_mode_protected_env_vars LD_LIBRARY_PATH LD_LIBRARY_PATH
url_rewriter.tags a=href,area=href,frame=src,input=src,form=fakeentry,img=src a=href,area=href,frame=src,input=src,form=fakeentry,img=src
user_agent no value no value

tokenizer
Tokenizer Support enabled

wddx
WDDX Support enabled

xml
XML Support active
XML Namespace Support active
EXPAT Version 1.95.2

zlib
ZLib Support enabled
Compiled Version 1.1.4
Linked Version 1.1.4

Directive Local Value Master Value
zlib.output_compression On On
zlib.output_compression_level -1 -1
zlib.output_handler no value no value

Additional Modules
Module Name

Environment
Variable Value
ALLUSERSPROFILE C:\Documents and Settings\All Users
CommonProgramFiles C:\Program Files\Common Files
COMPUTERNAME D-W2KSERV
ComSpec C:\WINNT\system32\cmd.exe
CONTENT_LENGTH 0
GATEWAY_INTERFACE CGI/1.1
HTTPS off
HTTP_ACCEPT text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
HTTP_ACCEPT_LANGUAGE en-us,en;q=0.5
HTTP_CONNECTION keep-alive
HTTP_HOST localhost
HTTP_REFERER http://localhost/test/
HTTP_USER_AGENT Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5
HTTP_ACCEPT_ENCODING gzip,deflate,compress;q=0.9
HTTP_ACCEPT_CHARSET ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_KEEP_ALIVE 300
INSTANCE_ID 1
JAVA_HOME D:\j2sdk1.4.1_01
LOCAL_ADDR 127.0.0.1
NUMBER_OF_PROCESSORS 2
Os2LibPath C:\WINNT\system32\os2\dll;
OS Windows_NT
Path D:\Program Files\Perl\bin\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\FoundScan;d:\Program Files\FoundScan;D:\Program Files\Python21;D:\PROGRA~1\ULTRAE~1;D:\Progra~1\Resour~1;d:\progra~1\phoenix;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\Foundstone\FASL\
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PATH_TRANSLATED d:\test\phpinfo.php
PROCESSOR_ARCHITECTURE x86
PROCESSOR_IDENTIFIER x86 Family 6 Model 8 Stepping 3, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 0803
ProgramFiles C:\Program Files
REMOTE_ADDR 127.0.0.1
REMOTE_HOST 127.0.0.1
REQUEST_METHOD GET
SCRIPT_NAME /test/phpinfo.php
SERVER_NAME localhost
SERVER_PORT 80
SERVER_PORT_SECURE 0
SERVER_PROTOCOL HTTP/1.1
SERVER_SOFTWARE Microsoft-IIS/5.0
SystemDrive C:
SystemRoot C:\WINNT
TEMP D:\TEMP
TMP D:\TEMP
USERPROFILE C:\Documents and Settings\Default User
windir C:\WINNT
SCRIPT_FILENAME d:\test\phpinfo.php

PHP Variables
Variable Value
_SERVER["ALLUSERSPROFILE"] C:\\Documents and Settings\\All Users
_SERVER["CommonProgramFiles"] C:\\Program Files\\Common Files
_SERVER["COMPUTERNAME"] D-W2KSERV
_SERVER["ComSpec"] C:\\WINNT\\system32\\cmd.exe
_SERVER["CONTENT_LENGTH"] 0
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["HTTPS"] off
_SERVER["HTTP_ACCEPT"] text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-us,en;q=0.5
_SERVER["HTTP_CONNECTION"] keep-alive
_SERVER["HTTP_HOST"] localhost
_SERVER["HTTP_REFERER"] http://localhost/test/
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5
_SERVER["HTTP_ACCEPT_ENCODING"] gzip,deflate,compress;q=0.9
_SERVER["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.7
_SERVER["HTTP_KEEP_ALIVE"] 300
_SERVER["INSTANCE_ID"] 1
_SERVER["JAVA_HOME"] D:\\j2sdk1.4.1_01
_SERVER["LOCAL_ADDR"] 127.0.0.1
_SERVER["NUMBER_OF_PROCESSORS"] 2
_SERVER["Os2LibPath"] C:\\WINNT\\system32\\os2\\dll;
_SERVER["OS"] Windows_NT
_SERVER["Path"] D:\\Program Files\\Perl\\bin\\;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;C:\\Program Files\\FoundScan;d:\\Program Files\\FoundScan;D:\\Program Files\\Python21;D:\\PROGRA~1\\ULTRAE~1;D:\\Progra~1\\Resour~1;d:\\progra~1\\phoenix;C:\\Program Files\\Microsoft SQL Server\\80\\Tools\\BINN;C:\\Program Files\\Foundstone\\FASL\\
_SERVER["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_SERVER["PATH_TRANSLATED"] d:\\test\\phpinfo.php
_SERVER["PROCESSOR_ARCHITECTURE"] x86
_SERVER["PROCESSOR_IDENTIFIER"] x86 Family 6 Model 8 Stepping 3, GenuineIntel
_SERVER["PROCESSOR_LEVEL"] 6
_SERVER["PROCESSOR_REVISION"] 0803
_SERVER["ProgramFiles"] C:\\Program Files
_SERVER["REMOTE_ADDR"] 127.0.0.1
_SERVER["REMOTE_HOST"] 127.0.0.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["SCRIPT_NAME"] /test/phpinfo.php
_SERVER["SERVER_NAME"] localhost
_SERVER["SERVER_PORT"] 80
_SERVER["SERVER_PORT_SECURE"] 0
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["SERVER_SOFTWARE"] Microsoft-IIS/5.0
_SERVER["SystemDrive"] C:
_SERVER["SystemRoot"] C:\\WINNT
_SERVER["TEMP"] D:\\TEMP
_SERVER["TMP"] D:\\TEMP
_SERVER["USERPROFILE"] C:\\Documents and Settings\\Default User
_SERVER["windir"] C:\\WINNT
_SERVER["SCRIPT_FILENAME"] d:\\test\\phpinfo.php
_SERVER["PHP_SELF"] /test/phpinfo.php
_SERVER["argv"]

Array
(
)

_SERVER["argc"] 0
_ENV["ALLUSERSPROFILE"] C:\\Documents and Settings\\All Users
_ENV["CommonProgramFiles"] C:\\Program Files\\Common Files
_ENV["COMPUTERNAME"] D-W2KSERV
_ENV["ComSpec"] C:\\WINNT\\system32\\cmd.exe
_ENV["CONTENT_LENGTH"] 0
_ENV["GATEWAY_INTERFACE"] CGI/1.1
_ENV["HTTPS"] off
_ENV["HTTP_ACCEPT"] text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1
_ENV["HTTP_ACCEPT_LANGUAGE"] en-us,en;q=0.5
_ENV["HTTP_CONNECTION"] keep-alive
_ENV["HTTP_HOST"] localhost
_ENV["HTTP_REFERER"] http://localhost/test/
_ENV["HTTP_USER_AGENT"] Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5
_ENV["HTTP_ACCEPT_ENCODING"] gzip,deflate,compress;q=0.9
_ENV["HTTP_ACCEPT_CHARSET"] ISO-8859-1,utf-8;q=0.7,*;q=0.7
_ENV["HTTP_KEEP_ALIVE"] 300
_ENV["INSTANCE_ID"] 1
_ENV["JAVA_HOME"] D:\\j2sdk1.4.1_01
_ENV["LOCAL_ADDR"] 127.0.0.1
_ENV["NUMBER_OF_PROCESSORS"] 2
_ENV["Os2LibPath"] C:\\WINNT\\system32\\os2\\dll;
_ENV["OS"] Windows_NT
_ENV["Path"] D:\\Program Files\\Perl\\bin\\;C:\\WINNT\\system32;C:\\WINNT;C:\\WINNT\\System32\\Wbem;C:\\Program Files\\FoundScan;d:\\Program Files\\FoundScan;D:\\Program Files\\Python21;D:\\PROGRA~1\\ULTRAE~1;D:\\Progra~1\\Resour~1;d:\\progra~1\\phoenix;C:\\Program Files\\Microsoft SQL Server\\80\\Tools\\BINN;C:\\Program Files\\Foundstone\\FASL\\
_ENV["PATHEXT"] .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
_ENV["PATH_TRANSLATED"] d:\\test\\phpinfo.php
_ENV["PROCESSOR_ARCHITECTURE"] x86
_ENV["PROCESSOR_IDENTIFIER"] x86 Family 6 Model 8 Stepping 3, GenuineIntel
_ENV["PROCESSOR_LEVEL"] 6
_ENV["PROCESSOR_REVISION"] 0803
_ENV["ProgramFiles"] C:\\Program Files
_ENV["REMOTE_ADDR"] 127.0.0.1
_ENV["REMOTE_HOST"] 127.0.0.1
_ENV["REQUEST_METHOD"] GET
_ENV["SCRIPT_NAME"] /test/phpinfo.php
_ENV["SERVER_NAME"] localhost
_ENV["SERVER_PORT"] 80
_ENV["SERVER_PORT_SECURE"] 0
_ENV["SERVER_PROTOCOL"] HTTP/1.1
_ENV["SERVER_SOFTWARE"] Microsoft-IIS/5.0
_ENV["SystemDrive"] C:
_ENV["SystemRoot"] C:\\WINNT
_ENV["TEMP"] D:\\TEMP
_ENV["TMP"] D:\\TEMP
_ENV["USERPROFILE"] C:\\Documents and Settings\\Default User
_ENV["windir"] C:\\WINNT
_ENV["SCRIPT_FILENAME"] d:\\test\\phpinfo.php
 [2003-03-24 04:21 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 [2007-09-13 08:30 UTC] gfg at fgf dot hfh
http://www.meta-fx.com/
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 17:01:58 2024 UTC