简体   繁体   English

如何关闭 Laravel 调试模式

[英]How to trun off laravel debug mode

I get this Error in the Log file.我在日志文件中收到此错误。 The Problem is in the CMS i try to deaktivated the debu-mod.问题出在 CMS 中,我尝试禁用 debu-mod。 But i dont will turn off.但我不会关掉。

in the Logs i get this Error-Message and i think thats the reasson why it dont will turn off.在日志中,我收到此错误消息,我认为这就是它不会关闭的原因。

production.ERROR: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'option_id' cannot be null in /var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:449 production.ERROR:PDOException:SQLSTATE[23000]:违反完整性约束:1048 列“option_id”在/var/www/html/vendor/laravel/framework/src/Illuminate/Database/Connection.php:449 中不能为空

Tank your for your help :)坦克你的帮助:)

.env文件APP_DEBUG=true设置为APP_DEBUG=false以关闭生产模式下的调试消息。

goto Laravel Project config/app.php转到 Laravel 项目 config/app.php

'debug' => env('APP_DEBUG', false),

or .ENV或.ENV

APP_DEBUG=false

The amount of error detail your application displays through the browser is controlled by the app.debug configuration option in your config/app.php configuration file.您的应用程序通过浏览器显示的错误详细信息的数量由 config/app.php 配置文件中的 app.debug 配置选项控制。 By default, this configuration option is set to respect the APP_DEBUG environment variable, which is stored in your .env file.默认情况下,此配置选项设置为尊重存储在 .env 文件中的 APP_DEBUG 环境变量。

1) Local development , you should set the APP_DEBUG environment variable to true . 1)本地开发,你应该将APP_DEBUG环境变量设置为true

2) Production environment , this value should always be false . 2)生产环境,这个值应该一直是false

.env file .env 文件

APP_DEBUG=false // when you are in the production environment

APP_DEBUG=true // when you are in local development

laravel document Laravel 文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM