After upgrade from Magento 2.0.2 to 2.0.4 I am getting follwoing error message

  • On Mini Cart

    You don't have permission to access /pub/static/frontend/Magento/luma/en_US/Magento_Checkout/template/minicart/content.html on this server.

  • On Products Page

    You don't have permission to access /pub/static/frontend/Magento/luma/en_US/mage/gallery/gallery.html on this server.

I have upgraded system using Web Setup Wizard. I have taken following steps after upgrade

Index are regenerated,
Permission are applied again,
Flushed Magento Cache

3 Answers 3


To resolve your issue with permission permanently, you need to set your primary user group in Linux to be "www-data" most of the time but you need to check your which apache belongs to.

To check which groups you belong to, type:


in the command line.

To change primary user group type in:

usermod -G oldusergroup newprimaryusergroup

I have same issue but fix it using folowing step :

  1. Run following command php bin/magento setup:static-content:deploy
  2. Run php bin/magento setup:upgrade
  3. Run php bin/magento setup:di:compile
  4. Run php bin/magento cache:clean

Clear browser cache, you are done.


reset the permissions like here


and redeploy the static content with php bin/magento setup:static-content:deploy.

Make sure that you are assigning the right user to your files.

Other than that you can delete the whole pub/static folder except the .htaccess file and redeploy it with the command above.

  • I deleted the folder pub/static and executed php bin/magento setup:static-content:deploy but now everything is broken even after clearing magento cache.
    – Black
    Jul 9, 2019 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.