6

Migrating symfony apps to php 7 with no success.

Error messages:

Symfony 2.8:

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

Symfony 3.1:

Warning: session_regenerate_id(): Session object destruction failed. ID: user (path: /var/lib/php/sessions)

Problem

Now from the message I would guess php is trying to write sessions to files.

  • I use memcached handler for sessions, it is running and works with php 5.6.
  • If I use native_file handler - everything works.

I do not know how to make any sense from this. All answers I found to similar problems include switching from native_file to memcached (already using it), changing user and/or permissions for session dir (does not matter?), updating session handler to return true from some methods (updated and checked).

How do I debug this?

3
  • What returns dump(ini_get('session.save_handler')); command ? Commented Aug 22, 2016 at 9:38
  • Well, some magic happened... Dumped save_handler, it displayed user, changed to native_file and to memcached again - now it works! Not sure what happened, but other app on same server also started to work, nothing was changed, updated or anything. Will do more testing. Commented Aug 24, 2016 at 11:29
  • So I did not get to the bottom of this because in the end we just switched to redis. It works fine for php 5.6 and 7.1 and symfony 2.8-3.2. Commented May 26, 2017 at 13:50

2 Answers 2

1

Use
$ sudo service memcached start

Sign up to request clarification or add additional context in comments.

2 Comments

Well memcached is definitely running, no need for that. As I said, It worked with PHP 5.6.
That was the root of the problem on my docker container.. not sure what caused this issue to start happening all of a sudden, but installing memcached and starting the service fixed the problem, thank you!
-2

Set

php.auto_start=1   

in php.ini

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.