Other Common Smarty Errors

While the errors above are pretty common, the following are not the kind of errors related to your template coding practices, nor PHP configuration settings. Rather, they are related to system configuration issues, like permission bits being insufficient to open a file or a directory.

  • Warning: Smarty error: unable to read resource: “extra.tpl”: In order to fix this type of error, make sure that the permission bits associated with the file are the appropriate ones for your website. That is, the web server that handles your pages needs to be able to access this file. Also, there might be a typo on the filename that causes this error.
  • Fatal error: Smarty error: unable to write to $compile_dir: Smarty works with your templates by parsing them, and then it compiles the templates into PHP scripts to improve efficiency. That is, instead of having to parse the template each time your PHP script is requested, it will compile the template into a PHP version of it, and skip the parsing routine. It will usually only re-compile the template if it needs to, such as when the template file is modified. The error message above is related to this feature. The compiled templates directory (referenced as $compile_dir within Smarty) which is usually called templates_c needs to be configured in such a way that the web server is allowed to write new files to it. To fix this error, set the proper permission bits to the templates_c sub-directory.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.14.63