Showing results for 
Search instead for 
Did you mean: 

SELinux gotcha 2.1 -> 2.2 upgrade.

SELinux gotcha 2.1 -> 2.2 upgrade.

I just wanted to share a solution after a troubled 2.2 update.


I am using CentoOS 7.2 with SELinux enabled and discovered that my site was not loading. Looking into the exception.log I noticed errors writing to 

generated/code/Magento/MediaStorage/Model/File/Storage/ it seems that Magento moves the generated files from var in 2.1 so you will need to set your SELinux permissions appropriately.

sudo semanage fcontext -a -t httpd_sys_rw_content_t "generated(/.*)?"
sudo restorecon -vRF generated/



Re: SELinux gotcha 2.1 -> 2.2 upgrade.

Thanks for sharing Darren!

If you've found one of my answers useful, please give "Kudos" or "Accept as Solution" as appropriate. Thanks!