From:             lapo at lapo dot it
Operating system: Win2000
PHP version:      5.0.0RC2
PHP Bug Type:     Filesystem function related
Bug description:  fpassthru gives script timeout

Description:
------------
I used to use a little script (see below) to check logs from remote and it
worked like a charm with PHP4.3.2 both on FreeBSD and Win2000 (CGI on
IIS).

Upgrading to PHP5.0.0RC2, on Win2000, it gives timeout when file size is
'big' (e.g. it does definitely do so with a 5Mb log file).

Of course it should print only the last 5Kb of file, no matter the
filesize.

BTW: using @fread($file, 1024 * $n) instead of @fpassthru($file) works
perfectly and I'm doing so, but @fpassthru($file) SHOULD be more efficient
and I wuold like it to work, anyway.

Reproduce code:
---------------
$log_file = ini_get('error_log');
$n = 5;
$file = @fopen($log_file, 'r');
@fseek($file, -1024 * $n, SEEK_END);
@fpassthru($file);

Expected result:
----------------
Last 5Kb of log file content.

Actual result:
--------------
CGI timeout.

-- 
Edit bug report at http://bugs.php.net/?id=28618&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28618&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28618&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28618&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28618&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28618&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28618&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28618&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28618&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28618&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28618&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28618&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28618&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28618&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28618&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28618&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28618&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28618&r=float

Reply via email to