I have noticed that from time to time my Magento installation shows 404 on all pages. Panic!
After doing some research I found out that running:
chown -R root:www-data .
in the document folder solved the problem temporarily.
Until the next day and the problem is back.
I have since then been able to recreate the problem with that if I run:
php bin/magento setup:di:compile
it crashes and requires me to run the: chown -R root:www-data .
to fix the problem.
Why is this? Why do I always get these errors?
The error log shows problems with the cache folder:
`#0 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache/Backend/File.php(180): Zend_Cache::throwException('cache_dir "/var...')
1 /var/www/html/vendor/colinmollenhour/cache-backend-file/File.php(87):
Zend_Cache_Backend_File->setCacheDir('/var/www/html/v...')
2 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(153):
Cm_Cache_Backend_File->__construct(Array)
3 /var/www/html/vendor/magento/zendframework1/library/Zend/Cache.php(94):
Zend_Cache::_makeBackend('Cm_Cache_Backen...', Array, true, true)
4 /var/www/html/vendor/magento/framework/App/Cache/Frontend/Factory.php(156):
Zend_Cache::factory('Magento\Framewo...', 'Cm_Cache_Backen...', Array, Array, true, true, true)
5 /var/www/html/vendor/magento/framework/Cache/Frontend/Adapter/Zend.php(38):
Magento\Framework\App\Cache\Fronte" while reading response header from upstream, client: 172.68.182.104, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.kickacc.se" ^C`