ID: 30811 User updated by: cantrell at pobox dot com Reported By: cantrell at pobox dot com Status: Bogus Bug Type: Apache related Operating System: OS X, Linux PHP Version: 4.3.9 New Comment:
Um, I beg your pardon, but this is not a support question. This behavior is contradictory to the docs, and I'm pretty sure it's a bug. Please read my post a little more carefully. Note that I am not asking for help! The docs for virtual() say that it works with an Apache subquest. If that were the case, it would work just like SSI: the output of bar.php (which works *just fine* when called directly) would be inserted into foo.php where the virtual() call is. That's what the docs imply. It's not what happens. When PHP doesn't behave as documented, I think it's fair to consider that a bug. Previous Comments: ------------------------------------------------------------------------ [2004-11-17 17:06:04] [EMAIL PROTECTED] Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. Your code is similar to: <? require('./baz.php'); ?> Obviously baz.php is not in current directory of foo.php. ------------------------------------------------------------------------ [2004-11-17 07:30:28] cantrell at pobox dot com Description: ------------ When virtual() calls another page that contains require('./xyz'), the require() call breaks. But it works with require('xyz'), which smells really bad, and makes me think this is a bug and not just me missing something. Posted this to php-general, but got no feedback. Reproduced on OS X 10.3.6 + Apache 1.3.29 + PHP/4.3.4, and on Debian + Apache 1.3.31 + PHP/4.3.9-1. Reproduce code: --------------- ------ foo.php ------ This is foo. <?php virtual('subdir/bar.php'); ?> ------ foo.shtml (my "control group") ------ This is foo. <!--#include virtual="subdir/bar.php"--> ------ subdir/bar.php ------ This is bar. <?php require('./baz.php'); ?> ------ subdir/baz.php ------ This is baz. Expected result: ---------------- This is foo. This is bar. This is baz. [Note: foo.shtml correctly produces this output; foo.php should in theory work identically, but does not.] Actual result: -------------- This is foo. This is bar. Warning: main(./baz.php): failed to open stream: No such file or directory in /blah/blah/subdir/bar.php on line 2 Fatal error: main(): Failed opening required './baz.php' (include_path='.:/usr/local/lib/php') in /blah/blah/ subdir/bar.php on line 2 Oddly, it works if bar.php says require('baz.php') instead of require('./baz.php'). ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=30811&edit=1