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
Full path should be:
include('/home/xx/xx/domains/mydomain/webroot/file-to-include.php');
Or you should set the path like:
include(__DIR__ . '/../webroot/file-to-include.php'); // php version >= 5.3 include(dirname(__FILE__) . '/../webroot/file-to-include.php'); // php version < 5.3