|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-11-25 03:51 UTC] judd at ob-wan dot com
include("../application.php");
The above simple inclusion no longer works in
4.3.0RC1-Win32 where it worked fine in 4.2.3.
Looks like the typical Unix-user misunderstanding
of how Windows uses the filesystem to me.
*sigh* Will it never end...
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 27 21:00:01 2025 UTC |
My reply from the 26th: Hi Iliaa, OK, looks like you need further information to find this one. I would add further comments but bugs.php.net is frozen right now when attempting to edit bug reports. Let's take the following piece of code: ------------- <? /* application.php */ /* turn on verbose error reporting */ error_reporting(15); /* define a generic object */ class object {}; /* setup the configuration object */ $CFG = new object; $CFG->dbhost = "localhost"; $CFG->dbname = "mymarket"; $CFG->dbuser = "myuser"; $CFG->dbpass = "mypassword"; $CFG->wwwroot = "/Commerce/mymarket3"; $CFG->dirroot = ""; $CFG->templatedir = "$CFG->dirroot/templates"; $CFG->libdir = "$CFG->dirroot/lib"; $CFG->imagedir = "$CFG->wwwroot/images"; $CFG->wordlist = "$CFG->libdir/wordlist.txt"; $CFG->support = "support@mymarket.com"; /* define database error handling behavior, since we are in development * we will turn on all the debugging messages to help us troubleshoot */ $DB_DEBUG = true; $DB_DIE_ON_FAIL = true; /* load up standard libraries */ require("$CFG->libdir/stdlib.php"); require("$CFG->libdir/dblib.php"); require("$CFG->libdir/mymarket.php"); require("$CFG->libdir/cart.php"); ---------------------- In 4.2.3 this will work fine, whilst in 4.3.0RC1 you'll get an error on the line: require("$CFG->libdir/stdlib.php"); That's because there will be a slash prepended where it wasn't there before. Note that '$CFG->libdir' is made from '$CFG->dirroot' plus '/lib'. With '$CFG->dirroot' being empty this should resolve to no leading slash, which was correct in 4.2.3 but now isn't. Otherwise there's no way to include a relative path. I'd get in and fix this myself but I've spent far too many years repairing other people's broken code for free, and since this is my profession it doesn't make sense to do that any more. But a pointer on where the error might be ... if you're using Cygwin and changed versions, that's probably it. Get rid of it before you go blind and use MSVC 5.0 or later, it works. Really. Rob Judd Homepage: http://judd.ob-wan.comSo the problem is that 'require("/foobar.php");' does not find foobar under the current working dir?? If so, this really is not a bug but the correct behaviour.Pardon me, that syntax should be 'include ("../foobar.inc");' ... I just woke up. :0Some clarification needed..the error you got: "No such file or directory in C:\Xitami\webpages\Commerce\mymarket1\admin\index.php on line 8 Warning: Failed opening '../application.php' for inclusion" In index.php you have 'include("../application.php");' ? Is the path to "application.php": C:\Xitami\webpages\Commerce\mymarket1\admin\application.php ???while testing a third party script that does: require_once("db/foo.php"); i got an error reporting 'No such file or directory'. Being under Win OS, i checked to see if require_once("db\\foo.php"); would work. And it DOES!