php - Session start on an empty page causes an error; session_start(): Cannot send session cache limiter -


hi have php file empty , line of code in there

<?php session_start(); ?> 

no html mark-up or php code besides code above.

on localhost doesn't trigger error, when it's on server , visit page, new line printed on error log says

[25-apr-2016 05:43:34 utc] php warning: session_start(): cannot send session cache limiter - headers sent (output started @ path/to/file.php:1) in /path/to/file.php on line 1

the server running apache , php 5.6 if that's relevant, i've tried deleting .htacces file in case what's causing problem still no luck.

can point me in right direction see may causing issue? thanks!

problem : there invisible characters inside code file.

solution : if want fix error here quick way : sure must using sort of code editor save php file encoding "utf-8 bom" , upload saved file site , access file , have no problem..!

screenshot better guidance : enter image description here

reference url :

how fix "headers sent" error in php

if doesn't solve problem use solution :

  1. make sure there absolutely no whitespace before <?php
  2. put session_start() before ob_start() instead of after it.
  3. if fails, try commenting out session_start() 1 of includes might starting session, so: /** session_start(); **/

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -