JREAM Posted January 21, 2010 Share Posted January 21, 2010 I recently re-installed WAMP, and im not sure why this is happening.. DEFINE('root', dirname(__FILE__). '/'); echo root; Outputs: C:\Workspace\project_1/files/ Previously it would list like: http://workspace/project_1/files/ According to my localhost it's in. Does anyone know why this is? Link to comment https://forums.phpfreaks.com/topic/189263-linuxwindows-directory-paths/ Share on other sites More sharing options...
teamatomic Posted January 21, 2010 Share Posted January 21, 2010 I'd dont worry about it because apache will take /workspace/project_1/files/ on either OS. I put the actual cause to a windows gateism. HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/189263-linuxwindows-directory-paths/#findComment-999151 Share on other sites More sharing options...
gizmola Posted January 21, 2010 Share Posted January 21, 2010 I doubt seriously it ever included http:// ... __FILE__ is suppossed to be the "The full path and filename of the file. If used inside an include, the name of the included file is returned. Since PHP 4.0.2, __FILE__ always contains an absolute path with symlinks resolved whereas in older versions it contained relative path under some circumstances." If you're using this for includes, then it really doesn't matter what it is, so long as it resolves correctly. PHP is suppossed to do the right thing on windows regardless of whether or not the path seperator is "/" or "\" Link to comment https://forums.phpfreaks.com/topic/189263-linuxwindows-directory-paths/#findComment-999166 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.