I include many pages inside each other in my project, I face problem of incorrect paths inside the include, is there any way to include the file from the root,
I try to make like this
require_once("$_SERVER['DOCUMENT_ROOT']/crm/includes/opendb.php");
require_once("./includes/opendb.php");
require_once("../includes/opendb.php");
require_once("includes/opendb.php");
and all makes error in includeing the file, any suggestion plz?
Edit
I have 2 folders, controllers and includes, inside the controller I call opendb.php from includes folder, I make as demonstrated in an answer below
set_include_path('../includes/');
include 'opendb.php';
and
set_include_path('includes/');
include 'opendb.php';
but the same error
Warning: include(opendb.php) [function.include]: failed to open stream: No such file or directory in C:\AppServ\www\crm\controllers\Customer.controller.php on line
"$_SERVER['DOCUMENT_ROOT']/crm/includes/opendb.php"is incorrect: you can’t use apostrophes around array keys inside double quotes. Try one of these: