如何关闭Laravel show的错误信息?

I send AJAX request(GET) to POST API, the error is show:

Symfony \ Component \ HttpKernel \ Exception \ MethodNotAllowedHttpException
No message

This nice working.

But, if i setting APP_ENV=prod & APP_DEBUG=true to .env file, then run the test code, the error is show again.

I'm want to know what happen, thanks.


System: Windows 7 64bit PHP version: 7.2.8 64bit ZTS Laravel version: 5.6

This's my .env file:

APP_NAME=NiceKingdom
APP_ENV=prod
APP_KEY=base64:qrCfm9hckUV2n7Le87IEHDht+7WVJQ5fkEn6QHim9lU=
APP_DEBUG=false
APP_URL=http://www.nice-kingdom.uio

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=nice_kingdom
DB_USERNAME=nice_kingdom
DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=smtp.163.com
MAIL_PORT=25
MAIL_USERNAME=UioSun@163.com
MAIL_PASSWORD=111e22
MAIL_ENCRYPTION=null

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
doubaisui2526
doubaisui2526 我重新加载我的生产服务器缓存,现在,这很好用,谢谢!
一年多之前 回复
dongzhashou0116
dongzhashou0116 哦!对不起,这个代码拷贝来自我的本地文件,这是我的错误......
一年多之前 回复
dsgwdigu84950
dsgwdigu84950 如果要关闭错误消息,请设置APP_DEBUG=false
一年多之前 回复
douyin4875
douyin4875 如果此APP_KEY来自您的生产站点,请确保现在生成一个新的APP_KEY。
一年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐