Question

When I try to include a file like this:

include ("../folder/file.php");

I get an error:

Warning: include(): open_basedir restriction in effect. File(../folder/file.php) is not within the allowed path(s)

But when I try to include the same file like this:

include ($_SERVER['DOCUMENT_ROOT']."/folder/file.php");

It works properly. I appreciate any thoughts to make it work using the first way :)

Regards, ExChill

Was it helpful?

Solution

This should help ;) open_basedir settings in php.ini

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top