Directory error

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
Aravinthan
Forum Commoner
Posts: 84
Joined: Mon Jan 28, 2008 6:34 pm

Directory error

Post by Aravinthan »

Hi guys,

I have a problem with SiteRoot....

so I have this code here:

Code: Select all

<?php
//Main initiation file
//Whenever a page is load, the content below should be load.

//To keep track of the good file location
//The directory separator is now defined as the constant DS
defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);

//Define the site root, to be change when moving the site
defined('SITE_ROOT') ? null :
	define('SITE_ROOT', DS."www".DS."uw-ligues");

//Define library path (path to the include folder)
defined('LIB_PATH') ? null :
	define('LIB_PATH', SITE_ROOT.DS.'includes');

//Loading configuration file first
require_once(LIB_PATH.DS.'config.php');

//Loading basic functions
require_once(LIB_PATH.DS.'functions.php');

//Loading core object
require_once(LIB_PATH.DS.'class_session.php');
require_once(LIB_PATH.DS.'class_database.php');
require_once(LIB_PATH.DS.'class_database_object.php');


// Loading objects
require_once(LIB_PATH.DS.'class_player.php');
require_once(LIB_PATH.DS.'class_position.php');
require_once(LIB_PATH.DS.'class_view.php');
require_once(LIB_PATH.DS.'class_pagination.php');

// On met des valeurs par dŽfaut requises par PHP5
date_default_timezone_set('America/Montreal');
setlocale(LC_MONETARY, 'en_US');


?>
And it keeps returning me:
Warning: require_once(/www/uw-ligues/includes/config.php) [function.require-once]: failed to open stream: No such file or directory in /home/uweavec1/public_html/uw-ligues/includes/initialize.php on line 18

Fatal error: require_once() [function.require]: Failed opening required '/www/uw-ligues/includes/config.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/uweavec1/public_html/uw-ligues/includes/initialize.php on line 18
But the file is in the correct directory...

Thanks for your help,
ara
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Directory error

Post by Jade »

Do you have the correct permissions setup on the www directory? Have you tried fixing the site root instead of just trying to transform the include files? Are you on a Linux machine? I believe you can change your site root via the /etc/passwd file and your apache config file.
Aravinthan
Forum Commoner
Posts: 84
Joined: Mon Jan 28, 2008 6:34 pm

Re: Directory error

Post by Aravinthan »

Yh did all that...

The thing it worked fine yesterday.... but it seems to bug today..
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Directory error

Post by Jade »

Are you using a different browser today? What's changed since yesterday?
Post Reply