|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-11-17 17:06 UTC] tony2001@php.net
[2004-11-17 18:28 UTC] cantrell at pobox dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 10:00:01 2025 UTC |
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').