Warning: session_start (): unable to send session cache limiter - headers already sent

I get an error that is very common.

Warning: session_start (): cannot send session cookie - headers already sent (output started in / home / sabarspinmatic / public _html / testing / index.php: 1) in / home / sabarspinmatic / public_html / testing / index.php in line 1

But it is strange that I have only one php file with only 1 session_start () line.

PHP code:

<? session_start() ?>

Can anyone know why I am getting this error. I checked the source code and its display <br />. I do not know why it shows this tag.

Error checking URL: http://www.sabarspinmatic.com/testing/

// PART 2 I just use single file index.php without using .htaccess and only l lines of code. I tried installing php at the beginning of the tag, but it does not work.

+4
source share
5 answers

First, I suggest that you use the correct start tag <?phponly for readability and portability of the code - not all web servers are configured to support a shorter version <?.

, <?php session_start() ... . (, Windows) - , HEXADECIMAL, , <?php .... , , UTF-8.

, : ; - , , .

+1

-, php

<?php   ?>

,

<?  ?>

?

0

2 . 1) , include session_start(). 2) , session_start() . .

0

. ,

:

..whitespace..<?php

0

... - (BOM) EFBBBF . , , .

0

Source: https://habr.com/ru/post/1629114/


All Articles