Answer the question
In order to leave comments, you need to log in
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
Answer the question
In order to leave comments, you need to log in
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)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question