Such a problem: Previously, the site was on Linux, when transferring to my local web server on windows, Smarti began to create empty compiled files, in which only the standard Smarty comment:
<!--?php /* Smarty version 2.6.19, created on 2019-02-20 18:28:08 compiled from index.tpl */ ?-->
Version smarty - 2.6.19 Folder paths are specified correctly. There are no problems with rights, because this is a Windows. I tried to put Smarty_Test.class.php and do a test, here is the result:
string(42) "Z:/home/svau.com/www/admin/smarty/plugins/" testing start: template_dir is 'Z:/home/svau.com/www/template/' real system path: Z:\home\svau.com\www\template file perms: 0777 OK. compile_dir is 'Z:/home/svau.com/www/admin/smarty/template-c-site/' real system path: Z:\home\svau.com\www\admin\smarty\template-c-site file perms: 0777 OK. cache_dir is 'Z:/home/svau.com/www/admin/smarty/cache/' real system path: Z:\home\svau.com\www\admin\smarty\cache file perms: 0777 OK. testing complete.
Config:
function mysmarty_site() { global $config; $this->Smarty(); $this->template_dir="$config[project_path]/template/"; $this->compile_dir="$config[project_path]/admin/smarty/template-c-site/"; $this->plugins_dir="$config[project_path]/admin/smarty/plugins/"; $this->config_dir="$config[project_path]/admin/smarty/config/"; $this->cache_dir="$config[project_path]/admin/smarty/cache/"; $this->default_modifiers=array('escape_ss'); $this->left_delimiter='{{'; $this->right_delimiter='}}'; $this->caching = true; $this->debugging = true; $this->force_compile = true; $this->error_reporting= E_ALL | E_ERROR | E_PARSE | E_COMPILE_ERROR | E_CORE_ERROR | E_USER_ERROR | E_RECOVERABLE_ERROR; $this->test(); die; }
I have no idea what the problem is, please help.
$config[project_path]
after such lines check the php log file, there will be something about the undefined constantproject_path
, you forgot to wrap this string quotes. And for reliability and readability, still use the brackets"{$config['project_path']}"
- teran