When the thinkphp project is deployed on a Linux server, the following error occurs: "The template does not exist." How can this problem be solved?

Source: Internet
Author: User
When a project is deployed on a Linux server, some templates may report an error saying "the template does not exist: ApplicationAdmin .... ", This article introduces the solution to the error" template does not exist "when the thinkphp project is deployed on the Linux server. when the most recent project is deployed on the Linux server, some templates may report an error saying "the template does not exist:/Application/Admin /...."

After checking the files on the server, there is no missing file. if the file is uploaded to the server again, an error is returned. For some reason, it is a code issue.

After careful check, it is found thatFile name of the template:

All those who have used TP know that thinkphp will automatically get the file name named as the template when $ this-> display(metadata, such as a template file using getuserinfo.html.

For the method in the controller, I use the camper method, and the template name in the view layer also uses the camper method. For example, getuserinfo.html matches the template file of getuserinfo.html,! Thinkphp uses the name of the reader as the template name in the $ this-> display(example. the name of the reader is a small write, and the template name is getuserinfo.html.

In Windows, file names are case-insensitive. in Linux, an error is returned.

Solution:Either change the template file name to lowercase or $ this-> display('template file name 'folder (without .html ).

The details determine success or failure. I hope this article will help you. thank you for reading this article.

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.