Bug #18221 Updated: Massive slowdown in fwrite() when not printing any text

From: Date: Tue, 09 Jul 2002 12:09:55 +0000
Subject: Bug #18221 Updated: Massive slowdown in fwrite() when not printing any text
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-13595@lists.php.net to get a copy of this message
ID: 18221 Updated by: sniper@php.net Reported By: rca@spin.ch -Status: Open +Status: Feedback Bug Type: Filesystem function related Operating System: Linux 2.2.16 PHP Version: 4.2.1 New Comment: I can not reproduce this with latest CVS checkout of PHP (php 4.3.0-dev) so please try this snapshot: http://snaps.php.net/php4-latest.tar.gz And with what browser did this happen with? I get immediate 'Document contained no data' error with Netscape.. You should also update Apache to 1.3.26..as those versions you have are too old. Previous Comments: ------------------------------------------------------------------------ [2002-07-09 04:46:08] rca@spin.ch Also tested this in 4.2.1 on the same Apache/Linux combination. It's still a bug. ------------------------------------------------------------------------ [2002-07-08 06:08:29] derick@php.net Thank you for taking the time to report a problem with PHP. Unfortunately you are not using a current version of PHP -- the problem might already be fixed. Please download a new PHP version from http://www.php.net/downloads.php If you are able to reproduce the bug with one of the latest versions of PHP, please change the PHP version on this bug report to the version you tested and change the status back to "Open". Again, thank you for your continued support of PHP. ------------------------------------------------------------------------ [2002-07-08 06:07:28] rca@spin.ch Try the following code snippet on its own page: $filename = "foo.txt"; $content = "blah"; $fd = fopen($filename, "a"); fwrite($fd, $content); fwrite($fd, "\n"); fclose($fd); You'll notice that the file is created just as intended, but the browser will be left waiting for data for a LONG time. However, if you add this to the end of the script: print "test"; The page is finished and sent to the browser immediately, no delays at all. This was found by one of our students, not by me :) Verified on PHP 4.1.2 using Apache 1.3.12 and 1.3.20, the former on kernel 2.2.16, the latter 2.4.2. PHP configure line: './configure' '--with-png-dir=/usr' '--with-mysql=/usr/local/mysql' '--with-apxs' '--with-swf=/usr/lib/ swf' '--with-config-file-path=/etc/httpd/php.ini' '--enable-ftp' '--with-gd=/usr/' '--with-jpeg-dir=/usr' '-- with-ttf' '--with-zlib' '--with-t1lib' '--with-ming' '--with-config-file-path=/etc/httpd/php.ini' '--enable- trans-sid' '--with-imap' '--with-imap-ssl=/usr/include/openssl' ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18221&edit=1

« previous php.bugs (#13595) next »