Directory traversal

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I'm having a maddening problem that's probably simple in its solution.
I'm installing MediaWiki on a Windows 2003 Server under IIS, and I'm
having this error repeatedly:

Warning: require_once(../StartProfiler.php) [function.require-once]:
failed to open stream: No such file or directory in C:\Inetpub\vhosts
\....\includes\WebStart.php on line 69

As I understand it, the error is saying that it can't find the path to
the file "StartProfiler.php". As a matter of fact, this file exists
one directory level above the "\includes\" directory. It seems -- on a
*nix box at least, or perhaps an Apache web server -- that the
indicator "../" would tell PHP this fact. On my Windows setup,
however, it does not.

I changed the "../" to "..\", which worked for a little bit, but now
it's back to the same error.

Is this an easy issue? Am I missing something?

Thanks for any help you might have.


Re: Directory traversal

Brent wrote:
Quoted text here. Click to load it


paths starting with '.' are resolved relative to the current directory,  
which, in the common case, is NOT the directory where the script is.

Try using absolute paths, e.g.

require_once(dirname(__FILE__) . '/../StartProfiler.php');

gosha bine

extended php parser ~
blok ~

Site Timeline