I am having problems getting document from a custom script inside the theme. It simple not including the domain part.
Here is the current way I am using:
$root = realpath($_SERVER["DOCUMENT_ROOT"]);
and the path I get is like:
although I know it should be like:
I really have no idea how to fix that, what way I should use instead to get the domain folder get included. Manually defining it is not an option as it might change.
Maybe someone could suggest. Thank you.