yii2 HeadersAlreadySentException 報錯

An Error occurred while handling another error:
exception php

'yii\web\HeadersAlreadySentException' with message 'Headers already sent in /xxxx/xxxx/xxx.php on line 90.' in /xxxx/xxxx/vendor/yiisoft/yii2/web/Response.php:366web

Stack trace:
#0 /xxxx/xxxx/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders()
#1 /xxxx/xxxx/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response->send()
#2/xxxx/xxxx/vendor/yiisoft/yii2/base/ErrorHandler.php(111):json

yii\web\ErrorHandler->renderException(Object(yii\web\HeadersAlreadySentException))yii2

#3 [internal function]: yii\base\ErrorHandler->handleException(Object(yii\web\HeadersAlreadySentException))
#4 {main}yii

使用echo 輸出json格式輸出,結尾沒有加exit致使的報錯

轉自:https://blog.csdn.net/renamayu/article/details/79799208

.net

相關文章
相關標籤/搜索