I have a php file outside my webroot in which I want to include a file that is inside the webroot.
folder outside webroot - > php file in which
This should work
$_SERVER['DOCUMENT_ROOT']/home/xx/xx/domains/mydomain/webroot/file-to-include.php
And make sure you have access to that level.