[FIX] Ubuntu default tmp problems

Having struggled with this for months on and off and I finally identified the problems I’ve been having with my Cpanel/Ubuntu install of Piwik.

The installation instructions do not cover the issues you’ll hit if your *nix distro is not inheriting folder permissions when it creates new cached templates in template_c as well as other tmp folders/files.

The solution is to use the setfacl command to set permission defaults for your specific tmp folder.


setfacl -Rm d:u::rwx,d:g::rwx,d:o::rx /home/[b]piwikhost[/b]/public_html/[b]piwik[/b]/tmp

You will probably have to chown and chmod recursively to resolve any folders that were created before you ran the above but this seems to fix things

Thanks for the tip. Maybe I could create a FAQ about this or maybe we could automaticall detect and report a warning / help message.

Could you detail which problems /symptoms you had that were solved by this command?

The symptoms were constant errors with the /tmp/templates_c folder for admin views. The caching system was trying to generate directories and files but because of the Ubuntu ACL system it was not inhereting the parent directory permissions and hitting errors.

The setfacl command helped set the perms so they could be inherited properly.

As for tests… Can’t suggest one, but adding it to the FAQ would definitely be useful.

The symptoms were constant errors with the /tmp/templates_c folder for admin views.

did you note the error message that you got?

No, the error changed each time but from memory it was very similar to the one in your FAQ:


Unable to create the cache directory ( piwik/tmp/templates_c/66/77)

The problem you have is that the use of CHMOD and CHOWN do not resolve the inheritance issue so the existing sudo


chmod 777 -R piwik/tmp/

…solution does not work.

So, really, no you can’t test for it but you can add it to the FAQ.