@broros opened this Issue on May 19th 2020

after changing PHP mode to fcgi, matomo does not work...

sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php7.3-fpm
sudo service apache2 restart

The directory "/tmp/cache/tracker/" is not writable

this needs to be fixed

@tsteur commented on May 19th 2020 Member

Hi @broros thanks for creating the issue. Most likely this is a server configuration issue. Be good to check the file permissions and that the correct user can write these directories. Does your solution in https://github.com/matomo-org/matomo/issues/15509#issuecomment-581741383 not work anymore?

If PHP tells us a directory is not writable, then more than likely it is actually not writable for PHP. Maybe check what permissions these run.

@broros commented on May 19th 2020

I don't think you get it... it's not the folder permission. This happens when I change to FastCGI PHP mode Vs FPM

@broros commented on May 19th 2020

This should not be happening :(

@fealXX commented on May 20th 2020

If the problem happens after the change, the php-fpm service might run under a different user than the apache2 does and therefore has no write permission for the tracker folder.
Check your pool-Config for "Unix user/group of processes" and/or check with ps aux | grep php-fpm what user is running fpm.

@broros commented on May 20th 2020
  1. Limit the file systems writes your PHP application needs to do when running in a web context
  2. Keep those writes under a limited number of directories (ideally one)
  3. Abstract any file system read/writes to a single system which allows you to
  • Control the PHP umask when making file system read/writes
  • Provide user-friendly error-messaging/experience when you run into a permission problem
  • Swap in a different system for reads and writes (everything from transfers/writes via SFTP, or replacing the whole thing with redis)

Off the top of my head — Joomla, WordPress, Drupal, Laravel — they all have (intentionally or not) created platforms that hew to the above.

This Issue was closed on May 22nd 2020
Powered by GitHub Issue Mirror