|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7008 Virtual() does not work with Output Buffering
Submitted: 2000-10-04 03:35 UTC Modified: 2000-11-21 07:31 UTC
From: rich at todobebe dot com Assigned:
Status: Closed Package: Output Control
PHP Version: 4.0.2 OS: RedHat 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
32 + 33 = ?
Subscribe to this entry?

 [2000-10-04 03:35 UTC] rich at todobebe dot com
I'm using apache 1.3.12.

Configure Line ( from phpinfo() ):
./configure' '--with-gd=/usr/local' '--with-jpeg-dir=/usr/local' '--with-ttf=/usr/local' '--with-apxs=/www/bin/apxs' '--with-mysql=/usr/local/mysql' '--enable-sysvsem' '--enable-sysvshm' '--with-zlib' '--disable-debug' '--enable-inline-optimization' '--enable-wddx' '--enable-sockets' '--with-mm'

The bit of code that does it on my setup:


$content = ob_get_contents();


The code in the virtual() call should obviously be replaced with something relevant on your setup.

When virtual is called, the output is immediately sent to the browser and not assigned to $content . I have a virtually identical script using an include() instead of virtual() and it works perfectly.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2000-11-21 07:31 UTC]
This is because virtual actually calls another Apache
handler which executes another sub-request, outside of the
PHP process. Meaning, you cannot use OB mechanism with
virtual, because when Apache executes virtual(), it know
nothing on OB mechanism - in fact, it knows nothing about
PHP that run it either.

So you better use include() in this case. It's also more
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Jul 21 05:01:30 2024 UTC