Smarty template prompts Warning:smarty error:unable to read resource

Source: Internet
Author: User
Tags php and smarty template

PHP uses the template engine Smarty, read the template error prompt: Warning:smarty error:unable to read resource: "Index.html" in libs\smarty.class.php on line 109 5

Problem reason: The template directory is not set correctly

Workaround:

Call Echo $TPL->template_dir; on an error page View the location of the template, and modify the appropriate template to the correct location in the configuration file.

There's another possibility, clams. My index.html template file does not exist and will prompt for the template file to be found OH.


Attention:

A forward slash is the same as a backslash, but be aware that the backslash is an escape character in PHP and has no meaning. If you want to output single quotes ' It should be written ', so \ ' is actually/'. Note that the template file will be the same as the character set encoding that invokes the template file, otherwise the above error can occur!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.