So first check out my line of code below:
$env_config['tmpl_file_basepath'] = DOC_ROOT . '/tpl/';
DOC_ROOT is equal to $_SERVER[‘DOCUMENT_ROOT’] which is equal to /var/www/example.com/html/
So my code above would set that path to: /var/www/example.com/html/tpl/
However the tpl folder should actually be in /var/www/example.com/
So first is there any server variable that is equal to the domain root, rather than the public directory root? And if not, is there a way to go up a diretory such as:
$env_config['tmpl_file_basepath'] = DOC_ROOT . '../tpl/';
I tried that but instead it just did /var/www/example.com/html/../tpl/
If this site was just in one location, I could simply manually type in the server path, but this is a config file that is used on local, dev, and live so I can’t have it hardcoded. I’ve gotten everything else working. Thank you!
To go up one directory, you can use dirname: