2

After I upgraded PHP version of my website to 7.3, I started receiving this error message:

Recoverable fatal error: ini_set(): Cannot set 'user' save handler by ini_set() or session_module_name()

After my investigation, I found that the problem is in this line:

ini_set('session.save_handler', 'user');

As I see in php.ini, the default value is "files". I try to change the value to files, but it's the same. Until PHP 7.1, everything works fine, but on PHP 7.2 and PHP 7.3, I have this problem. I really can't understand why this function not working. It doesn't return any error, just a blank page with code 200 (not 500 as server error).

How do I solve this problem?

miken32
  • 42,008
  • 16
  • 111
  • 154
tyrlaka
  • 154
  • 1
  • 5
  • 13
  • 1
    I already change to PHP 7.3. My problem is that this function is not working in PHP code. – tyrlaka Apr 21 '19 at 19:29
  • I already check it, but i still can't understand why it's not working and how to fix it. That's why i wrote here, cuz i need some more explanation about it.. Also what is the function exactly i mean what is the difference between "user" and "files" etc.. – tyrlaka Apr 21 '19 at 19:36

1 Answers1

5

PHP 7.2 dropped the ability to change the session save handler to "user" using ini_set().

Use session_set_save_handler() instead, passing it a callable argument that acts as the session save handler.

You can find the announcement in the changelog:

Improved bug #73100 fix. 'user' save handler can only be set by session_set_save_handler()

miken32
  • 42,008
  • 16
  • 111
  • 154
liquidity
  • 1,312
  • 20
  • 27