CodeIgniter Forums
"Headers already sent..." critical error - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forum-28.html)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forum-30.html)
+--- Thread: "Headers already sent..." critical error (/thread-77760.html)



"Headers already sent..." critical error - donpwinston - 10-15-2020

Anyone have a clue as to what would cause this?

Code:
CRITICAL - 2020-10-15 06:34:46 --> ini_set(): Headers already sent. You cannot change the session module's ini settings at this time
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'ini_set(): Head...', '/opt/lampp/htdo...', 101, Array)
#1 /opt/lampp/htdocs/system/Session/Handlers/FileHandler.php(101): ini_set('session.save_pa...', '/opt/lampp/htdo...')
#2 /opt/lampp/htdocs/system/Config/Services.php(765): CodeIgniter\Session\Handlers\FileHandler->__construct(Object(Config\App), '172.17.21.46')
#3 /opt/lampp/htdocs/system/Config/BaseService.php(123): CodeIgniter\Config\Services::session(Object(Config\App), false)
#4 /opt/lampp/htdocs/system/Config/Services.php(754): CodeIgniter\Config\BaseService::getSharedInstance('session', NULL)
#5 /opt/lampp/htdocs/app/Controllers/Home.php(11): CodeIgniter\Config\Services::session()
#6 /opt/lampp/htdocs/system/CodeIgniter.php(882): App\Controllers\Home->__construct()
#7 /opt/lampp/htdocs/system/CodeIgniter.php(393): CodeIgniter\CodeIgniter->createController()
#8 /opt/lampp/htdocs/system/CodeIgniter.php(306): CodeIgniter\CodeIgniter->handleRequest(NULL, Object(Config\Cache), false)
#9 /opt/lampp/htdocs/public/index.php(45): CodeIgniter\CodeIgniter->run()
#10 {main}
CRITICAL - 2020-10-15 06:34:46 --> Uncaught ErrorException: Cannot modify header information - headers already sent by (output started at /opt/lampp/htdocs/app/Config/Events.php:27) in /opt/lampp/htdocs/system/Debug/Exceptions.php:161
Stack trace:
#0 [internal function]: CodeIgniter\Debug\Exceptions->errorHandler(2, 'Cannot modify h...', '/opt/lampp/htdo...', 161, Array)
#1 /opt/lampp/htdocs/system/Debug/Exceptions.php(161): header('HTTP/1.0 500 In...', true, 500)
#2 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException))
#3 {main}
  thrown
#0 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler()
#1 {main}


My test server does not do this. Don't know why.


RE: "Headers already sent..." critical error - InsiteFX - 10-15-2020

ini_set(): Headers already sent. You cannot change the session module's ini settings at this time in codeigniter