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.