josephernest/TinyAnalytics

Give the good permissions out-of-the-box in the install package

Closed this issue · 2 comments

Can we have git clone ... (or unzip the package) give the good permissions already? We just need that PHP (www-data user?) can write in logs/.

This would avoid install step 2 (permissions).

Note: As an example installing WordPress with git clone https://github.com/WordPress/WordPress.git leads to the same situation: the user has to manually change the permissions. If not, here is the problem.

Todo: In index.php, if we detect wrong permissions that don't allow tracker.php to work, display a message:

<?php
echo 'Please give the right permissions to this folder with: chown -R ' . exec('whoami') . ' ' . realpath(dirname(__FILE__));
?>

Done in branch without-cron. To be tested and merged.