Smarty outputs blank page

旧时模样 提交于 2019-12-05 09:54:57

Change the permission of templates_c directory.

Give folder permission to folder smarty/template_c.

I using Mac so follow this steps:

  • Open Terminal
  • Go to htdocs folder
  • Go to project
  • Go to Smarty lib
  • Use command

    "chmod -R 0777 template_c"
    

My project is exists on the folder

    naveenos-MacBook-Pro:smarty nos$ chmod -R 0777 /Application/XAMPP/htdocs/smartyProject/lib/smarty/templates_c/

That's it.

Try adding error checking to you page

ini_set('display_errors', true);
error_reporting(E_ALL + E_NOTICE);

If that gets you nothing, I would try setting the $smarty->config_dir and $smarty->cache_dir attributes. They might be needed.

And, of course, make sure the file permissions for all the directories are valid, and that SAFE_MODE is off. (That can mess Smarty up in very odd ways.)

I had additional {foo.bar} (without $) variables in the template file that were supposed to be implemented later in the code, assuming Smarty would just replace those with blank I didn't think it could be those causing the problem, but after removing them it worked fine.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!