Reputation: 5
I was trying to include a php file with the code
include "$_SERVER[DOCUMENT_ROOT]/inc/file.php";
The error i was getting is
Warning: include() [function include]: unable to access C:/wamp/www/inc/file.php on line 6
Warning include(C:/...... Failed to open stream no error.
And i tried to use require_once; the error was the same my php version is 5.2
Upvotes: 0
Views: 156
Reputation: 84
set_include_path(get_include_path() . PATH_SEPARATOR . $_SERVER[DOCUMENT_ROOT]/inc);
include "$_SERVER[DOCUMENT_ROOT]/inc/file.php";
Upvotes: 0