Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Codeigniter - Cannot modify header information - headers already sent by

Tags:

codeigniter

A PHP Error was encountered
Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/aphotel/public_html/application/config/config.php:1)

Filename: libraries/Session.php

Line Number: 366
#

Weird part of it, there is no session.php file in libraries folder

like image 831
Panos Mavromytis Avatar asked Feb 08 '13 09:02

Panos Mavromytis


2 Answers

I had this problem before and it was caused by output_buffering was Off.

Edit your php.ini and search for output_buffering and make it looks like this

output_buffering = On
like image 67
Ashraf Kaabi Avatar answered Oct 21 '22 22:10

Ashraf Kaabi


In PHP Use " ob_start(); " at first line and in CI controller constructor at first line " ob_start(); " //output buffer

like image 26
Anil Gupta Avatar answered Oct 21 '22 20:10

Anil Gupta