php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #40989 PHPinfo output truncated
Submitted: 2007-04-04 04:07 UTC Modified: 2007-04-05 07:45 UTC
From: matt dot parrett at gmail dot com Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.2.1 OS: RHEL-latest
Private report: No CVE-ID: None
 [2007-04-04 04:07 UTC] matt dot parrett at gmail dot com
Description:
------------
php 5.2.1 compiled with: 

'./configure' '--prefix=/usr/local/php-5.2.1' '--with-apxs2=/usr/local/apache2.2/bin/apxs' '--with-mysql' '--with-mysqli' '--with-gd' '--with-pear' '--with-zlib-dir=/usr' '--with-mysql=/opt' '--with-jpeg-dir=/opt' '--with-png-dir=/opt'

<?php phpinfo(); ?> seems to give truncated output when viewed in a browser. Using wget to retrieve the page gives the expected result. php -i gives proper output. 

It seems like PHP or our configuration of PHP is doing something wacky with the headers. Not really sure what to look at though. I've configured everything by the book, and have used the same configuration on another server without trouble. 

Additionally, IE attempts to display the page, then has second thoughts and says 'page cannot be displayed'. We are having similar weird issues with some of our scripts, and found that the simple phpinfo page does the same thing.

This is a brand new server with fresh compiles of Apache 2.2 and PHP 5.2.1 - I've tested with PHP 4.4.4 (similar compilation options) and get the same result. 

Reproduce code:
---------------
<?php phpinfo(); ?>

Expected result:
----------------
Full PHPinfo with PHP Variables section at the bottom.

Actual result:
--------------
Output ends prior to HTTP Headers Information. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-04 08:17 UTC] tony2001@php.net
Use "View source" to see what exactly you got from the server.
Did you try a working browser instead of IE?
 [2007-04-04 15:15 UTC] matt dot parrett at gmail dot com
I've tried all the browsers I have access to. Each seems to break during phpinfo() in it's own unique way.

In Firefox 2.0.0.3, the output of phpinfo is truncated when viewing source. The output stops after SCRIPT_FILENAME. There is a closing TD and an opening TD tag following SCRIPT_FILENAME. 

In Opera 9.10, something similar happens, although in a slightly different spot (immediately after GATEWAY_INTERFACE)

--- 

Regarding the script we developed (that generates about 1000 html rows with 8 columns) seems to go weird somewhere after 6,000 lines of output. When viewing source, I see <??????????????????????????????????? inserted in a 'random' spot. I also experienced this using wget, but currently cannot seem to reproduce that behavior. Currently, the output just stops -- but only when using a browser. wget retrieves the entire thing just fine. The one time I observed this, the 300kb html file was bloated to 6MB and contained a huge middle section of <????????

Could this have something to do with the interplay of the browser and our php distribution or configuration? We use output buffering quite extensively... 

Thanks. Please let me know if you need anything else.
 [2007-04-04 15:30 UTC] matt dot parrett at gmail dot com
Here's another tidbit that may be helpful.

I tried a simple test that works flawlessly on another server that we have. On the troublemaker, PHP seems to start having trouble at about 16Kb of output. Just like with phpinfo and our main script, this test works fine as long as you access it using wget or the CLI. 

<?php
   for($i=0;$i<1000;$i++) {
      echo 'start row:'.$i;
      for($j=0;$j<9;$j++) {
         echo 'cell:'.$j;
      }
      echo 'end row:'.$i;
   }
?>

I'd like to rule this out as being a bug. There's a good chance it's not, but I can't seem to prove it either way.
 [2007-04-04 15:38 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

Make sure you disabled all zend_extensions and try the snapshot above.
 [2007-04-04 16:05 UTC] matt dot parrett at gmail dot com
Make failed. Any suggestions except for trying it without GD?

ext/gd/.libs/gd.o(.text+0x537): In function `zm_shutdown_gd':
/usr/local/src/php5.2-200704041430/ext/gd/gd.c:1208: undefined reference to `gdFontCacheMutexShutdown'
ext/gd/.libs/gd.o(.text+0x57a): In function `zm_startup_gd':
/usr/local/src/php5.2-200704041430/ext/gd/gd.c:1223: undefined reference to `gdFontCacheMutexSetup'
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
 [2007-04-04 16:10 UTC] tony2001@php.net
Is GD required to reproduce it?
 [2007-04-04 16:38 UTC] scottmac@php.net
I've just compiled the same extension without problem, what's the exact configure line that you used?
 [2007-04-04 16:45 UTC] matt dot parrett at gmail dot com
I compiled without GD, and tested the latest snapshot as you requested. I'm experiencing the same behavior as I described before. 

I used the configure line I pasted in the original bug report.
 [2007-04-04 16:47 UTC] matt dot parrett at gmail dot com
The only thing I changed was the prefix. /usr/local/php5-snapshot

In any case, GD is not required to reproduce the behavior.
 [2007-04-04 18:03 UTC] tony2001@php.net
I'm still unable to replicate it.
 [2007-04-04 18:14 UTC] matt dot parrett at gmail dot com
Is there some interplay between apache and PHP that might be required to reproduce this? 

For apache, we used 2.2.4 sources with

./configure --prefix=/usr/local/apache-2.2.4 -without-suexec-userdir -with-mpm=prefork --enable-so --enable-rewrite
 [2007-04-04 18:20 UTC] tony2001@php.net
Is the data received by the browser correct?
Are there any firewalls or filters between the server and the browser?
Where can I see the problem? (is there a public http server?)

 [2007-04-04 19:02 UTC] matt dot parrett at gmail dot com
Tony,

I sent you an email with info on how to access the misbehaving page, since this is a project for an internal admin page.
 [2007-04-04 20:04 UTC] tony2001@php.net
If you look at the source of the page, you'd see lots of null bytes.
Make sure you don't have any firewalls (including hardware ones) or anything else that might affect the output.
And try to rebuild Apache using minimal configuration.
Doesn't seem to be PHP problem, PHP doesn't insert 600K of null bytes in phpinfo().
 [2007-04-04 23:53 UTC] matt dot parrett at gmail dot com
We have a rack with a hardware firewall, and have iptables on most servers. I don't see anything different on this server. Our other servers seem to have no trouble with PHP. It seems pretty likely that this isn't a PHP bug, so I will stop expending your resources. 

Thank you for your time.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Jul 19 07:00:02 2025 UTC