Page 1 of 1

Trying to move up directories in PHP

Posted: Wed May 09, 2007 12:30 pm
by snowrhythm
Hi, I'm trying to include a file with require_once but I'm getting an error instead of results! oh nose!

Code: Select all

require_once '../../config.php';
As you can see, I'm trying to go up two directories. I'm getting this error:

Warning: require_once(../../config.php) [function.require-once]: failed to open stream: No such file or directory in D:\ServerApps\www\dev\parthunter-v2\php\views\viewmaster_class.php on line 3

Does anyone know how to do this? Any help is greatly appreciated.

Posted: Wed May 09, 2007 12:56 pm
by Grim...
That's correct.
Are you sure the file is there (D:\ServerApps\www\dev\config.php) and not in the php folder?

Is that line of code in another included file that is in a different folder to the main file?

Posted: Wed May 09, 2007 1:09 pm
by snowrhythm
actually it's in the parthunter-v2 folder. Do i need one less "../" ?

Posted: Thu May 10, 2007 10:58 am
by snowrhythm
i figured it out....just a dumb mistake. :cry: