A
A
Alexander2018-04-21 15:05:09
Yii
Alexander, 2018-04-21 15:05:09

How to fix error in yii2 Headers already sent?

I updated yii from the archive and threw in controllers, models, views from a previously written project. and got this error.

Fatal error: Uncaught yii\web\HeadersAlreadySentException: Headers already sent in /home/alex/server/foogine.io/vendor/yiisoft/yii2/web/Response.php on line 414. in /home/alex/server/foogine.io/vendor/yiisoft/yii2/web/Response.php:366 Stack trace: #0 /home/alex/server/foogine.io/vendor/yiisoft/yii2/web/Response.php(339): yii\web\Response->sendHeaders() #1 /home/alex/server/foogine.io/vendor/yiisoft/yii2/web/ErrorHandler.php(135): yii\web\Response->send() #2 /home/alex/server/foogine.io/vendor/yiisoft/yii2/base/ErrorHandler.php(262): yii\web\ErrorHandler->renderException(Object(yii\base\ErrorException)) #3 [internal function]: yii\base\ErrorHandler->handleFatalError() #4 {main} thrown in /home/alex/server/foogine.io/vendor/yiisoft/yii2/web/Response.php on line 366

I scratched my turnips, I thought that perhaps the controllers, models and views from the old version somehow conflict. I installed a fresh version of yii and decided not to add my own script, but to see if the problem is in the stock state. Installed opened the start page and saw the same error.
5adb289b2fef2660425943.png
From this we can conclude that the problem is in yii itself. Googled on this topic, but alas, found nothing. It looks like this bug is recent and not much is known about it. Who faced similar explain how to fix this error? Hope a solution exists.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2018-04-21
@BugFixMan

In general, everything turned out to be banal. The matter is that I on nonsense in php.ini uncommented dll libraries which are intended for Windows. On Linux, these lines do not need to be touched. Because of this, an error appeared that the debugger in yii could not intercept. The output of this error confused all the cards. The error probably floated in the place where yii formed headers because of this and the problems started. I commented out the lines with the windows modules in php.ini, now everything works. Hooray)

D
Dmitry, 2018-04-21
@demon416nds

bomremover to the rescue

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question