Jump to content

Relative paths in virtual directory not working.


Octo

Recommended Posts

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.

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.)

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.