站点用到了smarty,迁移到其他服务器的时候结果不能使用提示类似于这样:
Warning: Smarty error: unable to read resource: "index.htm" in .../smarty/libs/Smarty.class.php on line 1092
这种情况就是无法读取到index.htm文件,所以只需要修改一下这个Smarty.class.php中的配置信息即可。
打开文件找到下面这些内容的位置:
    /**
     * The name of the directory where templates are located.
     *
     * @var string
     */
    var $template_dir    =  'templates';
    /**
     * The directory where compiled templates are located.
     *
     * @var string
     */
    var $compile_dir     =  'templates_c';
只需要把这两个变量的值改成模板文件夹的相对路径即可。这里是相对于站点路径的相对路径,
我如说我的域名lab.xxx.xxx.xxx这个站点就是使用smarty的站点。现在我的模板文件的路径是
lab.xxx.xxx.xxx/smarty/templates,所以我要把上面两个设置成
smart/templates和smarty/templates_c
 
没有评论:
发表评论