Trying to move up directories in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
snowrhythm
Forum Commoner
Posts: 75
Joined: Thu May 04, 2006 1:14 pm
Location: North Bay Area, CA

Trying to move up directories in PHP

Post 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.
Grim...
DevNet Resident
Posts: 1445
Joined: Tue May 18, 2004 5:32 am
Location: London, UK

Post 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?
User avatar
snowrhythm
Forum Commoner
Posts: 75
Joined: Thu May 04, 2006 1:14 pm
Location: North Bay Area, CA

Post by snowrhythm »

actually it's in the parthunter-v2 folder. Do i need one less "../" ?
User avatar
snowrhythm
Forum Commoner
Posts: 75
Joined: Thu May 04, 2006 1:14 pm
Location: North Bay Area, CA

Post by snowrhythm »

i figured it out....just a dumb mistake. :cry:
Post Reply