PHP warning

session_start(): Session cannot be started after headers have already been sent

/hosting/verdevida/public_html/contato-formulario.php(2)

01 <?php
02 session_start();
03 $contato = new Contato();
04 
05 if(is_array($_POST['Contato'])){
06     Utf8::decode($_POST);
07 
08     $contato->attributes = $_POST['Contato'];
09     $contato->data = date('d/m/Y H:i:s');
10     $contato->ip = $_SERVER['REMOTE_ADDR'];
11     // $contato->session_id = session_id();
12     if($contato->validate()){
13         $contato->save();
14         // $contato->enviaNotificacao();

Stack Trace

#0
+
 /hosting/verdevida/public_html/contato-formulario.php(2): session_start()
1 <?php
2 session_start();
3 $contato = new Contato();
4 
5 if(is_array($_POST['Contato'])){
6     Utf8::decode($_POST);
7 
#1
+
 /hosting/verdevida/public_html/RequestManager.php(171): require_once("/hosting/verdevida/public_html/contato-formulario.php")
166             Utf8::encode($html);
167             echo $html;
168             exit;
169         }
170 
171         require_once($require_file);
172         exit;
173 
174     }
175 
176 }
#2
+
 /hosting/verdevida/public_html/index.php(53): RequestManager->run(array("/" => "inicial.php", "/index" => "inicial.php", "/inicial" => "inicial.php", "/index.php" => "inicial.php", ...))
48     '/voluntario-form'=>'voluntario-envia.php',
49 
50 );
51 
52 $request_manager = new RequestManager();
53 $request_manager->run($rotas);
2023-02-07 06:09:44 Apache Yii Framework/1.1.13