#20616 [Opn]: 4.3.0RC1-Win32 cannot find files found by 4.2.3

From: Date: Fri, 29 Nov 2002 13:08:59 +0000
Subject: #20616 [Opn]: 4.3.0RC1-Win32 cannot find files found by 4.2.3
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-26179@lists.php.net to get a copy of this message
ID: 20616 User updated by: judd@ob-wan.com Reported By: judd@ob-wan.com Status: Open Bug Type: Unknown/Other Function Operating System: Win 2k server PHP Version: 4.3.0RC1 New Comment: 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.com Previous Comments: ------------------------------------------------------------------------ [2002-11-29 06:59:28] judd@ob-wan.com RC2 also fails identically, see error message below. You might also like to complete the HTML tags in the error messages so that an error displays correctly. Relying on a browser version that doesn't mind missing </body></html> tags is a Bad Idea(tm). Warning: main(../application.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in C:\Xitami\webpages\Commerce\mymarket1\admin\index.php on line 8 Warning: Failed opening '../application.php' for inclusion (include_path='.;c:\php4\pear') in C:\Xitami\webpages\Commerce\mymarket1\admin\index.php on line 8 Fatal error: Call to undefined function: pv() in C:\Xitami\webpages\Commerce\mymarket1\admin\templates\header.php on line 3 ------------------------------------------------------------------------ [2002-11-25 08:56:33] iliaa@php.net Using the given information I cannot replicate the problem. ------------------------------------------------------------------------ [2002-11-25 03:51:40] judd@ob-wan.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... ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20616&edit=1

« previous php.bugs (#26179) next »