I put the index module into public as written in the manual, and the application directory of the entry file was also changed.
Then the URL is servername/public/index.php
Online The tutorial says to directly set the website root directory to public.
Then I would like to ask, why can the index module be directly accessed when it is placed in the application?
The entrance is placed in the public for security reasons, so that the web cannot directly access the controller or template file without going through the entrance. This is safer and will not be attacked by hackers. Only access to open access points in the public is allowed. Not only TP5, the laravel framework is also in the public.