php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23264 readfile with Apache2+PHP 4.3.1 generates unwanted "xx sec.<br>" text
Submitted: 2003-04-17 15:56 UTC Modified: 2003-04-27 03:04 UTC
From: angelo at ispltd dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.1 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: angelo at ispltd dot com
New email:
PHP Version: OS:

 

 [2003-04-17 15:56 UTC] angelo at ispltd dot com
I upgraded my server from Apache 1.3.20 and PHP 4.0.6 to 
Apache 2.0.44 and PHP 4.3.1.  Now my app which was working 
does not, and I can't figure out why. 
 
The code generating output is simply this: 
 
header("Content-type: application/pdf"); 
$bytes = @readfile($fulldoc); 
 
Those two lines are back-to-back, and the "header" has to be 
first or I would get an error, so I know there's nothing else in the 
output stream. 
 
With Mozilla there are no problems, but with MSIE the PDF 
document will load once then on subsequent reloads it displays 
"### sec.<br>" ("###" being an integer) before file's actual 
content.  This causes MSIE to display the unformatted (raw) 
content of the PDF file. 
 
Apparently this is showing the number of seconds for 
something?  If I keep clicking back-arrow then reload the PDF 
file, the number of seconds keeps increasing.  Once 60 
seconds has elapsed since the first load, it again loads 
properly.  So I can go back-and-forth (back-arrow, click the 
document, back-arrow, click the document) and watch the 
seconds rise, then it reaches 60 and the document again 
displays properly using Acrobat. 
 
I've tried readfile() with "@" and with & without assigning result 
to a variable; no difference. 
 
I am running a mostly "stock" PHP.INI file copied from the 
"recommended" distribution file -- I just changed "safe_mode" to 
and "expose_php" to "Off" and "register_globals" to "On". 
 
My configure line is as follows: 
 
./configure --prefix=/usr/share --datadir=/usr/share/php 
--bindir=/usr/bin --libdir=/usr/share --with-config-file-path=/etc 
--with-exec-dir=/usr/lib/php/bin --with-mysql=/usr --with-gd=yes 
--enable-gd-native-ttf --enable-gd-imgstrttf --with-tiff-dir=/usr 
--with-jpeg-dir=/usr --with-png-dir=/usr 
--with-xpm-dir=/usr/X11R6 --with-zlib=yes --with-bz2 --with-gmp 
--with-xml --with-ttf --with-t1lib --with-mcal=/usr --with-imap=yes 
--with-sablot --with-readline --with-ftp --with-ndbm --with-gdbm 
--with-mcrypt --with-gettext --with-mm --with-gd=yes 
--enable-versioning --enable-yp --enable-bcmath 
--enable-trans-sid --enable-inline-optimization 
--enable-track-vars --enable-magic-quotes --enable-safe-mode 
--enable-sockets --enable-sysvsem --enable-sysvshm 
--enable-calendar --enable-ftp --enable-memory-limit 
--enable-force-cgi-redirect --with-openssl --with-curl 
--with-imap-ssl --with-gd=yes 
--with-apxs2=/usr/local/apache2/bin/apxs --with-snmp 
--disable-ipv6 --with-pear 
 
Thank you in advance for any help in solving this. 
 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-04-23 00:18 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.


 [2003-04-24 14:57 UTC] angelo at ispltd dot com
I downloaded the latest snapshot (200304241730) and installed 
it.  No improvement; problem still exists. 
 
I tried this: 
 
header("Content-type: text/plain"); 
echo "test"; 
 
and it opens in the Linux Advanced Editor, showing the same 
"xx sec.<br>" message at the top of the file; after 60 seconds 
the counter resets. 
 
My client tried accessing the document on two different 
computers and found the same situation exists, so it's not a 
user-specific problem. 
 
Could there be some debugging code that got left somewhere?
 [2003-04-24 14:59 UTC] angelo at ispltd dot com
I should have said "session-specific" not "user-specific" in my 
last comment.  What I mean is that the message seems to be 
global in its scope, not showing time elapsed for a session for 
for some larger scope of the PHP process instead.
 [2003-04-25 17:11 UTC] sniper@php.net
I can not reproduce this with apache2.0.45 + php 4.3.2-rc.
Please provide a complete but short example script which
can be used to reproduce it.

 [2003-04-27 03:03 UTC] angelo at ispltd dot com
Gee I feel like such a dummy.  In trying to give a simple 
example, I discovered it was in my own code.  Please forgive my 
error and thanks very much for trying to help.
 [2003-04-27 03:04 UTC] magnus@php.net
Not a bug => Bogus 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 10:01:31 2024 UTC