|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26500 Bug in virtual()
Submitted: 2003-12-02 12:00 UTC Modified: 2003-12-02 22:18 UTC
Avg. Score:4.2 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: karmak-php at karmak dot org Assigned:
Status: Wont fix Package: Apache related
PHP Version: 4.3.3 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.
Block user comment
Status: Assign to:
Bug Type:
From: karmak-php at karmak dot org
New email:
PHP Version: OS:


 [2003-12-02 12:00 UTC] karmak-php at karmak dot org
(Note: This was originally posted in combination with a segfault bug, which got prematurely closed)

PHPs virtual() does not behave quite like the apache
#include virtual="": When virtual() is used to call another php script, the query string in the virtual() call is ignored. For example, if you call virtual("/file?x=y"), the variable "x" will not be set in the included php script. An example of this is posted at:

The source for the two files used in this example are at:

However, if you call the first script as "a1?x=y", the variable "x" will be set to "y" in the second script. 

This is not the way the Apache virtual function behaves: With Apache, the query string in the virtual call is passed to the script, as can be seen in the following shtml file:

The source to this file is at:

Furthermore, all query string variables are reset when the virtual call is issued. This can be seen by calling the shtml file:

With the corresponding source code at:

Note that the x=y declaration is not passed to the php script.

Reproduce code:
See Description for URLs

Expected result:
See Description

Actual result:
See Description


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-12-02 22:18 UTC]
When calling virtual the GET/POST/COOKIE for the current script (the one calling) virtual get passed to the script's who's output is included via virtual. Use file_get_contents() instead.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Nov 27 02:03:14 2021 UTC