note 25966 added to function.require-once
| From: | PHPMatrix at rack1 dot php dot net | Date: | Sun, 13 Oct 2002 06:30:59 +0000 |
| Subject: | note 25966 added to function.require-once | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-38004@lists.php.net to get a copy of this message | ||
As for that absolute thing, I think Windows and UNIX prase this differently. Windows will include a
absolute path from the document root but UNIX includes it from the root / . In addition to the
above post I have used a work around to this so it will always call from the document root no matter
what platform you use.
<?php $docroot = $_SERVER['DOCUMENT_ROOT']; ?>
<?php require_once("$docroot/subdir/phpfile.php"); ?>
Just set the varable $docroot to the doc root then begin the require or include with $docroot and it
will include from the document root all the time.
(I use Windows 2K Pro running Apache 2 for testing but the production server is UNIX running Apache
1.36 and this seems to work)
--
http://www.php.net/manual/en/function.require-once.php
http://master.php.net/manage/user-notes.php?action=edit+25966
http://master.php.net/manage/user-notes.php?action=delete+25966
http://master.php.net/manage/user-notes.php?action=reject+25966