Yii method to block error prompts: first open the entry file "index.php"; then add "error_reporting (0);"; finally comment "defined('YII_DEBUG') or define('YII_DEBUG', true);" that's it.
yii Shield error prompt
Process in the entry file index.php:
Add Top:error_reporting (0);
Comments:defined('YII_DEBUG') or define('YII_DEBUG',true);
Recommended : "yiiTutorial"
In addition: The error handler is registered in the constructor method in the application, using the PHP functions set_exception_handler and set_error_handler. If you don't want Yii to handle errors and exceptions, you can define YII_ENABLE_ERROR_HANDLER and YII_ENABLE_EXCEPTION_HANDLER as false in the entry file.
The above is the detailed content of How to block error prompts in Yii. For more information, please follow other related articles on the PHP Chinese website!