matomo
matomo copied to clipboard
Matomo couldn't write to some directories (running as user 'www-data').
Matomo was working yesterday. Today I tried to install security info pluging and it's now reporting the following error:
Matomo couldn't write to some directories (running as user 'www-data').
Try to Execute the following commands on your server, to allow Write access on these directories:
chown -R www-data:www-data /srv/www/matomo
find /srv/www/matomo/plugins -type f -exec chmod 644 {} \;
find /srv/www/matomo/plugins -type d -exec chmod 755 {} \;
If this doesn't work, you can try to create the directories with your FTP software, and set the CHMOD to 0755 (or 0777 if 0755 is not enough). To do so with your FTP software, right click on the directories then click permissions.
After applying the modifications, you can refresh the page
If you need more help, try Matomo.org.
First, I don't want /srv/www/matomo to be owned by the webserver. This is generally bad practice, why are you suggesting this?
tmp as well as plugins however are owned by matomo. (plugin shouldn't be owned by the webserver either but it's ok temporarily when installing a plugin via GUI).
So I set everything in ./plugin 755 and owned by webserver but I still get that error...
drwxr-xr-x 68 www-data www-data 4096 Feb 14 18:02 .
drwxr-xr-x 13 luser luser 4096 Feb 17 13:29 ..
drwxr-xr-x 12 www-data www-data 4096 Feb 3 05:13 Actions
drwxr-xr-x 7 www-data www-data 4096 Feb 3 05:13 Annotations
...
Hello.
Even after just running the commands suggested in the error, the message still persists.
Hi, same problem here
same here in my docker install
this doesn't help at all
chown -R www-data:www-data /var/www/html
chmod -R 777 /var/www/html/plugins
Same problem here, in a docker install
vim /etc/php-fpm.d/www.conf user = root group = root
then run : php-fpm -R I do it like that ,and it works!
So I encountered this today after updating my containers. I'm running matomo in a docker compose setup. I was able to fix it like this:
docker-compose exec matomo /bin/bash # start ssh shell in matomo container
chown -R www-data:www-data /var/www/html # change ownership of the folder
Hey there. Sorry to hear you are all having problems with permissions. Unfortunately there is not much we can do about that. If the permission doesn't allow creating certain files or directories Matomo will show an error. We might suggest to grant some permissions that might look a bit too wide, but this should at least fix it for most users. Also the write access to the Matomo folder might be needed in case of running an update in the UI, as it might add files or folders in that directory. Nevertheless if the commands don't help for you please try to get some help on our forums. For permission problems with the docker container please consider raising an issue here instead: https://github.com/matomo-org/docker
Same problem running in a Apache Server/Rocky 8. I've tried giving 0777 to all the folders and still didn't work. The service is running under the user "apache" and when I logged in as that user, I had permissions to read/write to the folders that were being requested.
@sgiehl - I know it's closed and my suggestion isn't about this particular issue, but I believe you should mention on this error page ("Matomo couldn't write to some directories... ") that the /matomo/tmp
dir should have its permissions set to 775. Unless I'm mistaken :) But it worked in my case.