Description
Preconditions
- Have Magento installed with two filesystem owners as documented, with all code files (source and CLI-generated) read-only for web server user. This includes the full
pub/static
directory. - Turn on the merging of CSS or JS files.
Steps to reproduce
Clear static file cache and load home page.
Expected result
No exception should be generated.
Actual result
Exception is logged:
[2018-01-16 16:18:56] main.CRITICAL: Directory "/var/www/html/___/pub/static/_cache/merged" cannot be created Warning!mkdir(): Permission denied {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): Directory \"/var/www/html/___/pub/static/_cache/merged\" cannot be created Warning!mkdir(): Permission denied at /var/www/html/___/vendor/magento/framework/Filesystem/Driver/File.php:225)"} []
Commentary
This could arguably be seen as a documentation issue in which case I can report it in the devdocs repo. However, as I understand it, it seems that the documentation does describe the intended state, meaning the code should be changed instead. I'm not sure if it's possible, but if it were, ideally the merged files would be generated by static-content:deploy
as alluded to in #9542. This would allow multiple servers in a cluster to be certain to have the merged files present in response to requests without the directory being shared among the nodes.