Octo Posted November 30, 2010 Share Posted November 30, 2010 Using IIS 6, PHP is working in the virtual directory, except relative paths for things like file_exists. if (file_exists('another/file.php')) {echo "success";} require 'another/file.php'; echo $required_variable; // success From the test file above, include 'another/file.php' and require 'another/file.php' type statements will work fine in the v-dir, but not is_readable('another/file.php') or file exists('another/file.php) et al. These non-working paths will work if made absolute (C:/some/folders/another/file.php) though. The relative paths work fine in the main directory (all works as expected there). What's also unusual is that if I open a working mirror in the main directory (though in a different sub-directory), the broken one will start working as it borrows everything from the working one, even though it's set up site.com->test (v-dir) and site.com->live doc_root is empty, setting include_path seems to make no difference, putting './' at the front doesn't work. Have tried all the settings I can on the v-dir. Have checked MS documentation on how to set it up. Kind of at a loss here and any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/220216-relative-paths-in-virtual-directory-not-working/ Share on other sites More sharing options...
ruslany Posted December 1, 2010 Share Posted December 1, 2010 I have not tried this on IIS 6, but on IIS 7 this works as expected. I am going to try on IIS 6 to confirm. What do you use to run PHP on IIS 6? Is it via FastCGI? Quote Link to comment https://forums.phpfreaks.com/topic/220216-relative-paths-in-virtual-directory-not-working/#findComment-1141892 Share on other sites More sharing options...
Octo Posted December 1, 2010 Author Share Posted December 1, 2010 Yeah, works fine on IIS7 (my test server is 7.5, the live server for the client is IIS6). As for FastCGI - I'm not a server admin, so while I have an idea what that is I'm not sure about how to set it up/check it's working right etc. However, I'll look into that since you mention it. (Note, the reason I'm doing the admin stuff is because they don't have one. I wrote the program and so am helping them set stuff up while I'm at it.) Quote Link to comment https://forums.phpfreaks.com/topic/220216-relative-paths-in-virtual-directory-not-working/#findComment-1141902 Share on other sites More sharing options...
Doug G Posted December 1, 2010 Share Posted December 1, 2010 Any errors? One thing to check is the 'allow parent paths' setting in IIS, that is sometimes the cause of problems with the same code on different servers. Quote Link to comment https://forums.phpfreaks.com/topic/220216-relative-paths-in-virtual-directory-not-working/#findComment-1142015 Share on other sites More sharing options...
Octo Posted December 2, 2010 Author Share Posted December 2, 2010 No errors on the page, just typical PHP errors "class not found on....". When I fix the classes, it doesn't find my 'view' files, so I just get a blank page with no errors on it, even with E_ALL on. Should probably set it to write some to an error.log actually. Enable parent paths didn't work I'm afraid, either on or off. Not had a chance to look into FastCGI yet. How do I find out whether it's using it or not. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/220216-relative-paths-in-virtual-directory-not-working/#findComment-1142032 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.