Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP7 fpm + Symfony 2.8 - 3.1, using memcached but failed to write session data to file

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?

like image 422
Aurelijus Rozenas Avatar asked Jul 22 '16 06:07

Aurelijus Rozenas


1 Answers

Use
$ sudo service memcached start

like image 170
Rafał Przetakowski Avatar answered Nov 02 '22 21:11

Rafał Przetakowski