Seeing the 500 Internal Server Error? There’s a variety of possible problems of which the common one is incorrect file & directory permissions. This can happen even straight after unpacking the Piwik.zip and trying to start the install process.
Here’s a quick guide to fix those pesky Piwik access permissions.
You could go check out the logs to see what the actual problem is; or if you have command line access (SSH) you may harmlessly execute these two commands in your Piwik directory to see if that does it for you — and if not read on.
##change correct directory permissions
find . -type d -exec chmod 755 {} \;
##change correct file permissions
find . -type f -exec chmod 644 {} \;
Or as dear Matthieu (creator of Piwik) put it: “You should be able to lock down all folders except piwik/tmp folder which needs to be writable.”
Which isn’t all that helpful.
First (1) assuming you have cPanel; you may proceed to “Errors“, where you might be seeing code similar to this:
[Fri Apr 21 01:01:01 2017] [error] [client 1.1.1.1] SoftException in Application.cpp:254: File “/home/myblog/public_html/piwik/index.php” is writeable by group
[Fri Apr 21 01:01:01 2017] [error] [client 1.1.1.1] SoftException in Application.cpp:608: Directory “/home/myblog/public_html/piwik” is writeable by group
Second (2) as in this case; the problem is that “group” has write access to the PHP files and Piwik directory. Anyway this should give you a suggestion towards the right direction if it’s an issue with permissions or not.
Third (3) if you cannot access the command line you can either use “File Manager” in cPanel or your own ftp client. Either way these are the correct permissions:
- Directories: 755 (-rwxr-xr-x)
- Files: 644 (-rw-r–r–)
The only problem is that you cannot recursively change the permissions; which is very easy with command line as suggested above. I’ve heard FlashFXP is one ftp client that does recursive jobs; or you could just contact your web administrator and ask them to fix things for you (it’s a quick job most cases).
Hope it helps and just let me know if any questions arise!
Dave Walls