php - What's the Variable for Domain Root? Or a Way to go up a Directory? -


so first check out line of code below:

$env_config['tmpl_file_basepath'] = doc_root . '/tpl/'; 

doc_root equal $_server['document_root'] equal /var/www/example.com/html/

so code above set path to: /var/www/example.com/html/tpl/

however tpl folder should in /var/www/example.com/

so first there server variable equal domain root, rather public directory root? , if not, there way go diretory such as:

$env_config['tmpl_file_basepath'] = doc_root . '../tpl/'; 

i tried instead did /var/www/example.com/html/../tpl/

if site in 1 location, manually type in server path, config file used on local, dev, , live can't have hardcoded. i've gotten else working. thank you!

to go 1 directory, can use dirname:

$env_config['tmpl_file_basepath'] = dirname(doc_root) . '/tpl/'; 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -