This should help ;) open_basedir settings in php.ini
Using "../" causes open_basedir restriction error
-
01-07-2022 - |
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
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow