PHP Warning: session_start(): Cannot start session when headers already sent in
superoraculus opened this issue · 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: , server: _, request: "GET /login.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.4-fpm.sock:", host: ""
Thank you!
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.
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(); ?>