Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#651 closed Bug (fixed)

Piwik requires session.save_handler: files

Reported by: hass Owned by:
Priority: normal Milestone: RobotRock
Component: Core Keywords:
Cc: Sensitive:


There is a problem where piwik throws error messages and isn't working at all. This happens if PHP is correctly configured for Drupal CMS ( The source of this issue is "session.save_handler: user".

; Handler used to store/retrieve data.
session.save_handler = user

As a workaround I tried using "files", but I'm not sure if this may break
something in Drupal...

; Handler used to store/retrieve data.
session.save_handler = files

The error message that is thown is:

Fatal error: session_start() [<a
href='function.session-start'>function.session-start</a>]: Failed to
initialize storage module: user (path: C:\Programme\PHP\sessions) in
piwik\index.php on line 42

Are you able to fix this bug soon, please?

Change History (10)

comment:1 Changed 5 years ago by vipsoft (robocoder)

  • Milestone set to RobotRock
  • Priority changed from critical to normal
  • Summary changed from Piwik crashes with session.save_handler: user to Piwik requires with session.save_handler: files

Piwik doesn't implement its own session save handler, hence 'files' (i.e., default to PHP's built-in handler). We have no plans to implement our own session save handler. [WONTFIX]

That said, session.save_handler doesn't have to be set in the master php.ini; supposedly, it can also be set by PHP script, .htaccess, and/or httpd.conf. That could be a Drupal or Piwik change.

Lowering priority.

In Piwik's ./index.php, can you add:

@ini_set('session.save_handler', 'files');

comment:2 Changed 5 years ago by vipsoft (robocoder)

  • Summary changed from Piwik requires with session.save_handler: files to Piwik requires session.save_handler: files

comment:3 Changed 5 years ago by hass

I hope you understand that Drupal and other users don't understand the error message and cannot handle this. I don't like to point all people to this case opening issues in my issue queue at This are recurring issues.

It would be better if this is much more user friendlier and would work like many other applications that do not require "files" with both users and files.

Code wise this should be solvable with "5 lines" of code...

comment:4 Changed 5 years ago by vipsoft (robocoder)

Cool. I look forward to seeing your patch.

comment:5 Changed 5 years ago by matt (mattab)

I'm actually unsure of what the proper "fix" would be for this problem...?
how does Wordpress (or other OS softwares) deal with this?

comment:6 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [1070]) Fixed #651 by setting session.save_handler explicitly.

comment:7 Changed 5 years ago by vipsoft (robocoder)

Tested by setting "session.save_handler = user" in master php.ini, and restarting apache.

comment:8 Changed 5 years ago by hass

Does this means the latest piwik version contains a solution for this issue or are you not able to repro?

comment:9 Changed 5 years ago by vipsoft (robocoder)

I reproduced the error you reported in the problem description by setting "session.save_handler = user" in my master php.ini (i.e., /etc/php5/apache2/php.ini) and restarting apache.

Matt and I aren't aware of the "5 lines" fix that you hinted at, but I commited the one-liner that I proposed in comment:1 and observed that Piwik runs fine (again) as a standalone app. While I have not tested this with Drupal, I believe it is consistent with the .htaccess workaround that you currently require for Drupal-Piwik users.

Please re-open this ticket if the problem persists.

comment:10 Changed 5 years ago by alivenk

Note: See TracTickets for help on using tickets.