Home > Backend Development > PHP Tutorial > How to enable error prompts in TP5?

How to enable error prompts in TP5?

一个新手
Release: 2023-03-16 12:54:01
Original
3675 people have browsed it

How to enable error prompts in TP5?

How to enable error prompts in TP5:

When using the tp5 framework, the error message will not be displayed during testing, only "The page has an error" will be displayed. , I have checked many methods, and now I will summarize:

tp5 does not display error messages in deployment mode. To enable debugging mode,

set define in public/index.php, which is the entry file. ('APP_DEBUG', true);

Set in config.php

'SHOW_PAGE_TRACE'=>true,
'debug' =>true,

After turning on the debugging mode, I found that the error was still not displayed. I checked convention.php (under the file entry thinkphp) and found that there is an item in the exception and error settings
'show_error_msg' => false, change it to true, and then the error message will be displayed.

Supplement:

I found that tp5 has two files, config.php and database.php, in the application directory. You can modify them directly in these two files, so there is no need. Create a new conf/config.php to modify it. If this file is created, the original settings of config.php and database.php in the application directory will be invalid.

For more related knowledge, please visit PHP Chinese website! !

The above is the detailed content of How to enable error prompts in TP5?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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