php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14710 Please either change include/require/virtual directive, or create new one!
Submitted: 2001-12-27 01:13 UTC Modified: 2002-01-28 21:21 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: nospamo at nospamo dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.0.6 OS:
Private report: No CVE-ID: None
 [2001-12-27 01:13 UTC] nospamo at nospamo dot com
I have been searching the php.net forums, bug tracker, etc for a way to do the following, and perhaps misread the "virtual" php operator, but in any case:

Php needs to include SSI functionality in regards to using relative paths on files being included, eg:

If I have a php file, "$HOME/htdocs/static/header.php", and have a tree structure below "htdocs", I cannot find a legit way to include header.php in a relative fashion, eg "include /header.php".  "../../../../header.php" or "/full/path/to/header.php" are not solutions I am looking for :)

That being said, "virtual" seems to encompass what I am looking to do at a cursory glance, but i'm concerned that I may lose some functionality down the road.  From the current php.net manual on the "virtual" function:

"virtual() cannot be used to include a document which is itself a PHP file."

Please, please, PLEASE either create a new directive/option:
 (<? php ssi("/static/header.php") ?>

... or modify the existing ones.

If virtual *is* intended to be the fix, please update the documentation as it is either outdated or misleading (to me anyhew :)

Basically, I need full php functionality *AND* the ability to include other php files in a fully relative nature (EXACTLY like SSI is currently implemented).

Thanks!

Further diags:

If I try the following:

<?php include ("/static/header.php"); ?>

I get:

Warning: Failed opening '/static/header.php' for inclusion (include_path='.:/web/htdocs/user/static') in /web/htdocs/user/index.php on line 0

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Jan 24 21:03:34 2022 UTC