akitchin Posted April 20, 2007 Share Posted April 20, 2007 hey there, i often define a system path variable with the filesystem-based path to the current working directory, like so: define('SYS_PATH', '/projects/somedir/somesubdir'); where projects is a directory immediately below the directory set as my localhost. this works on *nix machines, but the path seems to trump any windows machines with a "The file cannot be found" error: require_once(SYS_PATH.'/includes/something.php'); the path echoed in the error is exactly the path to the file, and the file is there. furthermore, the filesystem path in the $_SERVER array is the one i use in SYS_PATH, so i see no reason why it should work on *nix but not windows. anyone know of some discrepancies between directory handling? all server settings are the same, the only difference being in the OS. i'd appreciate any help, since this makes local testing utterly useless. Quote Link to comment https://forums.phpfreaks.com/topic/47932-filesystem-path-issues/ Share on other sites More sharing options...
akitchin Posted May 2, 2007 Author Share Posted May 2, 2007 bumpity bump bump. nobody has any insights? Quote Link to comment https://forums.phpfreaks.com/topic/47932-filesystem-path-issues/#findComment-243355 Share on other sites More sharing options...
akitchin Posted August 8, 2007 Author Share Posted August 8, 2007 going to bump this again, one last time. Quote Link to comment https://forums.phpfreaks.com/topic/47932-filesystem-path-issues/#findComment-318879 Share on other sites More sharing options...
teng84 Posted August 8, 2007 Share Posted August 8, 2007 its hard to tell because we dont know the dir we use that style i our site but maybe all i can say is that you echo the full path in the include to see where you went wrong if you can do that without using the define then it has no diff with define Quote Link to comment https://forums.phpfreaks.com/topic/47932-filesystem-path-issues/#findComment-318884 Share on other sites More sharing options...
lemmin Posted August 8, 2007 Share Posted August 8, 2007 I think on windows the working dir is stored with a "/" at the end. it should work if you take the "/" off the beginning of your path. define('SYS_PATH', 'projects/somedir/somesubdir'); You might even need to put a "/" at the end of it too, in some cases, I'm not sure. Quote Link to comment https://forums.phpfreaks.com/topic/47932-filesystem-path-issues/#findComment-318888 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.