Piwik Error, Unable to Start Session

TLDR: Fix the Piwik: Unable to Start Session error by running:

sudo chmod 0777 /path/to/piwik/tmp/sessions

Just documenting a solution for the “Unable to start session” error in Piwik 1.6. Basically, there’s a really common error where your perfectly fine Piwik install automagically makes itself fail to run after a week or two. The first error message you get will be about setting permissions for specific directories, and then you’ll get the error:

Piwik Error: Unable to Start Session.

The problem is that the web user needs to have write permissions for the directory /path/to/piwik/tmp/sessions. I found the solution on the dev portal here: http://dev.piwik.org/trac/ticket/2717.

After upgrade to Piwik 1.6 many users are reporting “Unable to start session” messages. It seems to happen when the piwik/tmp/sessions directory is not writable. INstead we should detect this before trying to start the session and if the directory is not writable, return the standard piwik error message showing the “chmod” help command.

-Trac/Tickets

Anyway, just run:

sudo chmod 0777 /path/to/piwik/tmp/sessions

e.g.

sudo chmod 0777 /home/public_html/website.com/piwik/tmp/sessions

Congratulations, you’re no longer unable to start a session.

Oh, if you don’t want to deal with the weird code-related issues all of the time, register a trial account with Clicky. I don’t suggest Google Analytics just because it doesn’t give me as much information as Clicky and there’s always the issue of “Google knows everything” that seems to worry everyone. Whatever you do, don’t go with Woopra (should I link that? No..). It looks good until you realize that you have to reload the page 20-30 times to see your stats once.

Ugh. Anyway, enough wasted time and just go with Clicky.

Leave a Comment

Your email address will not be published.