Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
superoraculus opened this issue Mar 25, 2022 · 2 comments

Comments

@superoraculus
Copy link

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!

@sibyperiyar
Copy link
Owner

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.

@superoraculus
Copy link
Author

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(); ?>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants