MountainMan Posted June 19, 2020 Share Posted June 19, 2020 Am using a moderately modded Frozen. Was surprised with a server move to PHP 7.2 from 7.1. Now having session errors ?? Not sure what is going on. I understand that session_start() must be called before outputting anything to the browser. Perhaps this is what the error is telling me? If so, how to track 'er down? Link to comment Share on other sites More sharing options...
♥ecartz Posted June 20, 2020 Share Posted June 20, 2020 In Phoenix, the line that triggers the session_set_save_handler call is in application_top.php at require 'includes/functions/sessions.php'; It seems to be claiming that output is being sent before that line. One possibility to find what is causing it is to keep moving that line higher in the file until it either works or you get a different error. Sometimes that helps if that line is not dependent on other code having run first. Could not be moved prior to the includes/configure.php line. Not sure about other dependencies. It does seem like PHP 7.2 became stricter in its session handling. So something that was always broken may now be announcing that it is broken. Compare what you have above that line and in files included before that to what Frozen has to see what may have changed. It's also worth noting that this can happen if you have a different error or warning displayed before the session started. You can fix that by turning off display_errors. E.g. at the top of includes/application_top.php put ini_set('display_errors', 0); Put it right before the starting time is set, after the previous comment is closed. That may shift things from totally broken to just moderately broken. If that is what the problem is. So this error would go away and you could concentrate on the other problems that would still be there. Always back up before making changes. Link to comment Share on other sites More sharing options...
♥ecartz Posted June 20, 2020 Share Posted June 20, 2020 Sorry, I had meant to post https://stackoverflow.com/questions/47700336/php-7-2-warning-cannot-change-session-name-when-session-is-active That's what gives me the idea that something changed in PHP 7.2. Always back up before making changes. Link to comment Share on other sites More sharing options...
Jack_mcs Posted June 20, 2020 Share Posted June 20, 2020 @MountainManYou may want to try clearing the sessions table. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
MountainMan Posted June 20, 2020 Author Share Posted June 20, 2020 3 hours ago, Jack_mcs said: @MountainManYou may want to try clearing the sessions table. Good thought. Thanks. Link to comment Share on other sites More sharing options...
MountainMan Posted June 20, 2020 Author Share Posted June 20, 2020 Headers WERE already sent, because I found a couple spaces at the beginning of a file, before the "<?php". Was it there all along and the upgrade to PHP 7.2 caught it..., well, just not smart enough to answer that question, and I gots to keep movin... Panic over. Site back up. Found it by creating a test page based on application_top. Stripped the contents from app_top to bare bones required for sessions, added some basic html at the bottom so it would function as a page, and poked and prodded until I found the offending file. It helped that while searching for answers I had read via our now questionable friend Google* that PHP was indeed becoming picky about added spaces at the beginning of a file. Appreciate everyone's help. *I say this because Google's search results appear to now heavily favor their paid advertisers. I remember pre-Google, at the beginning of this thing called the Internet, when there were the first initial attempts at search engines. Google caught on fast because their results at the time were trusted to be based on "relevance" whereas some of the other search engines back then were tinkering with taking money to be ranked higher. That's for you youngsters. Here's another one. Did you know professionals - doctors and lawyers - were not allowed to advertise... and look what you have now on TV, billboards, etc. Dont think it is an improvement. Thank God for my DVR. Link to comment Share on other sites More sharing options...
anya2001 Posted August 5, 2020 Share Posted August 5, 2020 Can you explain more about how you found the spaces? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.