Easy-HotSpot icon indicating copy to clipboard operation
Easy-HotSpot copied to clipboard

PHP Warning: session_start(): Cannot start session when headers already sent in

Open superoraculus opened this issue 2 years ago • 2 comments

Hello!

Any help in fixing this error is very appreciated

[error] 714#714: *30 FastCGI sent in stderr: "PHP message: PHP Warning: session_start(): Cannot start session when headers already sent in /var/www/easy-hotspot/login.php on line 2" while sending to client, client: <IP>, server: _, request: "GET /login.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: "<IP>"

Thank you!

superoraculus avatar Mar 25 '22 00:03 superoraculus

You have modified the code? Put any code or space or any character before the first executable line containing the session_start()? If then, remove those and try.

sibyperiyar avatar Mar 25 '22 04:03 sibyperiyar

It worked!

The login page lost its layout, but now I can proceed. Thanks!

<?php include('header.php'); ?> <--- line removed <?php if ( !isset($_SESSION) ) session_start(); ?>

superoraculus avatar Mar 25 '22 16:03 superoraculus