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!