Warning: session_start (): Can not send session cache limiter - headers already sent

2

I uploaded my page to 000webhost and when I log in, everything goes fine except that I see this error

  

Warning: session_start (): Can not send session cache limiter - headers   already sent (output started at   /storage/ssd5/679/2763679/public_html/LF/html/ico_notif.php:1) in   /storage/ssd5/679/2763679/public_html/LF/html/ico_notif.php on line 2

In that PHP I have this

(logically although I'm not there I have open and closed the php )

session_start();
require('funciones.php');
require('clases.php');
$usuario = usuarios::usuario_por_codigo($_SESSION["CodUsua"]);
    
asked by Carlos Saz 31.08.2017 в 21:51
source

2 answers

1

Try putting this at the beginning of the document:

@ob_start();
session_start();
require('funciones.php');
require('clases.php');
$usuario = usuarios::usuario_por_codigo($_SESSION["CodUsua"]);
    
answered by 30.11.2017 / 23:38
source
1

Headers already sent means that in code, PHP has already sent the HTTP headers, and therefore can not make modifications again until the session is cleared of the header.

Verify that you do not call session_start before. Better yet, just have a session_start in your PHP file (so put it in the absolute beginning, before all HTML, etc).

Ref: Spanish translation of the response from @houbysoft in SO in English .

    
answered by 31.08.2017 в 22:00