Smarty를 올바르게 사용하려고하면 설정 파일을 만들었습니다. http://www.smarty.net/docs/en/language.config.variables.tpl 이 작동하지 않습니다 여기에 설명 된대로 {config_load "main.conf"}
: main.tpl에서Smarty : 구성 파일을 찾을 수 없습니다.
/Smarty/
/Smarty/cache
/Smarty/configs
/Smarty/configs/main.conf
/Smarty/plugins
/Smarty/sysplugins
/Smarty/templates_c
/templates/
/templates/main.tpl
index.php
내가 의해 /Smarty/configs/main.conf에서 main.conf를로드하려고 : 파일 구조는 다음과 같다 ("치명적인 오류 : catch되지 않은 예외 메시지 'SmartyException'에서 ... main.conf을 '' '설정 파일을 읽을 수 없습니다'") :
{config_load "/var/www/vhosts/*domain*/subdomains/cms/httpdocs/Smarty/configs/main.conf"}
하지 않는 이유는 첫 번째 예, 그러나이 작업을 수행 작업? 이전에 config dir을 설정했습니다.
$smarty->setConfigDir(SMARTY_DIR.'configs/');
config dir을 찾을 수 없습니다. 누군가 나를 도울 수 있을까요? 미리 감사드립니다!
'setConfigDir'을 호출 한 후에'$ smarty-> getConfigDir()'을 출력하면 실제 경로를 볼 수 있습니다. – Eugene
@Eugene 경로가 올바른 것으로 보입니다. 그것은 print_rs : "Array ([0] =>/var/www/vhosts/* domain */subdomains/cms/httpdocs/Smarty/configs /)" –
파일의 사용 권한을 확인할 수 있습니까? 파일에 읽기 권한이 없을 수 있습니다. –