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

PHP7 sessions issue #3499

Closed
asmith20002 opened this issue Jun 19, 2016 · 16 comments
Closed

PHP7 sessions issue #3499

asmith20002 opened this issue Jun 19, 2016 · 16 comments
Milestone

Comments

@asmith20002
Copy link
Contributor

asmith20002 commented Jun 19, 2016

I'm randomly getting this error, even though this was addressed in #3230.

2: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/var/lib/php/sessions)

I've checked /var/lib/php/sessions permissions and it is set to 777. (owner is root though)

Ubuntu 14.04 LTS
PHP 7.0.3

@albertlast
Copy link
Collaborator

you are sure u got the newest version of https://github.com/SimpleMachines/SMF2.1/blob/release-2.1/Sources/Session.php ?

@asmith20002
Copy link
Contributor Author

asmith20002 commented Jun 20, 2016

I setup the forum about 2 months ago. but it seems the latest changes on Sessions.php was 5 months ago. I checked I have the latest Sessions.php

@asmith20002
Copy link
Contributor Author

Before the fix, I used to get this error on every page visit. Now I don't get it on every page, but it randomly appears in the log.

@albertlast
Copy link
Collaborator

did the error messages change?

@albertlast
Copy link
Collaborator

Please comment out the line 156 and 157 in the session.php

if (preg_match('~^[A-Za-z0-9,-]{16,64}$~', $session_id) == 0)
        return false;

to

//  if (preg_match('~^[A-Za-z0-9,-]{16,64}$~', $session_id) == 0)
//      return false;

And give me feedback.

@asmith20002
Copy link
Contributor Author

asmith20002 commented Jun 22, 2016

Just saw your comment now. I'll do that. Meanwhile:

I got this one now:

session_regenerate_id(): Session write failed. ID: user (path: /var/lib/php/sessions)

Subs-Auth.php
line 107

@jdarwood007
Copy link
Member

Are you sure your php process can access that?

When I upgraded to php7, my open_basedir restrictions prevented access to that location and sessions failed because it couldn't write there.

@asmith20002
Copy link
Contributor Author

asmith20002 commented Jun 23, 2016

Still getting those 2 errors. (after commenting that out)

open_basedir in php.ini in commented out. I can give you my phpinfo if it helps. That location's permission is set to 777. Tripled checked that by now. Owner is root though, should I change that as well?

@exotickg1
Copy link

exotickg1 commented Jul 6, 2016

+1 have same error. PHP 7.0.7 + nginx. I'm using Beta 2 from Downloads section.

I've change chmod permitions of /var/lib/php/sessions to 777
After this i have this errors log:

PHP Fatal error:  require_once(): Failed opening required '/QueryString.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/admin/web/mydomain.com/public_html/forum/index.php on line 49

PHP Notice:  Undefined variable: boarddir in /home/admin/web/mydomain.com/public_html/forum/index.php on line 45
PHP Notice:  Undefined variable: sourcedir in /home/admin/web/mydomain.com/public_html/forum/index.php on line 49

FIXED after updating Session.php from dev repository

@albertlast
Copy link
Collaborator

Please delete files and database completly,
and take the github version.

the download version is very very very old. and it exists no upgrade from beta 2 to github version.

@exotickg1
Copy link

@albertlast how i can upgrade properly? I have Beta 2 as as say from site. Just copy to FTP with files replacement? And how i can update Database? Thanks!

@albertlast
Copy link
Collaborator

it exists no update from beta 2 to github version,
the only update way thjis exists is from smf 2.0 to 2.1 gibthubversion.

@exotickg1
Copy link

@albertlast, that is, I can not just put the files on top of the previous ones?

@albertlast
Copy link
Collaborator

the important stuff that you delete database from beta 2,
the files could easy replaced.

@exotickg1
Copy link

exotickg1 commented Jul 6, 2016

@albertlast thaks for info, trying to reupgrage now. But one question, i can use upgrade.php (and other upgrade files) from Beta 2? Or not? Where i can take then?
Argh... sorry, didint see the "other" folder...

@exotickg1
Copy link

exotickg1 commented Jul 6, 2016

I've deploy my site (2.0.11) locally -> download repository -> move files with the replacement to my local drive and when i'm trying access to the site its dont loading and FastCGI process takes a lot of RAM. Cant normally upgrade 😞

UPD: Upgraded, by using upgrade.php, but index.php still cant be loaded. Just page load loop.
@albertlast can you help, please?

UPD2: Fixed. Russian translation probably dont properly rewrite index.php

@MissAllSunday MissAllSunday added this to the Beta 4 milestone Jul 13, 2016
@live627 live627 modified the milestones: Beta 4, Beta 3 Jan 11, 2017
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

6 participants