Home > PHP Framework > ThinkPHP > Solution to thinkphp 5 error display nginx 404 page

Solution to thinkphp 5 error display nginx 404 page

藏色散人
Release: 2021-07-07 09:15:40
forward
2937 people have browsed it

Solution to thinkphp 5 error display nginx 404 page

thinkphp 5 The error message displays the nginx 404 page

I deployed the project online today, but the error message appears, but the nginx 404 page is always displayed. , if it continues like this, the problem cannot be solved. I looked at thinkphp's log file online:

[ sql ] [ SQL ] SELECT `data_id`,`pid` FROM `tb_data_manage` WHERE  `pid` IN (53,49,47,46,35) [ RunTime:0.000595s ]
[ error ] [8]未定义数组索引: see[/data/web/data_manage/runtime/temp/5e9fc553d7acc7eaa186b674b2a29538.php:143]
Copy after login

Obviously, it is PHP that has an error, not nginx that cannot find the page, and nginx's pathinfo There is no problem with the settings. I also set app_debug in config.php to true, so I searched for solutions online. The final solution was to open the file think_exception.tpl under thinkphp/tpl at the end of the php file. Add an exit

        })();
    </script>
    <?php } exit; ?>
</body>
</html>
Copy after login

to the tag and the problem will be solved. If you access the browser again, 404 will no longer be displayed and the thinkphp error page will appear.

Related recommendations: The latest 10 thinkphp video tutorials

The above is the detailed content of Solution to thinkphp 5 error display nginx 404 page. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
php
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template