How to Set File Permissions for WordPress on Windows IIS

Motivation:

  • You have a WordPress instance on Windows IIS.
  • You upload a file. Its thumbnail is not shown in Media Library.
  • You change the file permission. Its thumbnail now is shown correctly in Media Library.
  • You upload another file and have to change the file permission manually again.
  • How can we make WordPress automatically set the correct permission for new uploaded files?

Procedure:

  1. Ensure that the the Identity of Application pool that the website is running under is ApplicationPoolIdentity.
  2. Execute below commands as Administrator
icacls "C:\inetpub\wwwroot\domain.com" /grant "IUSR":(OI)(CI)F /T 
icacls "C:\inetpub\wwwroot\domain.com" /grant "IIS_IUSRS":(OI)(CI)F /T

3. Set up IIS.

  • Open IIS Manager.
  • Click on your website.
  • Click Authentication.
  • Click Anonymous Authentication (which should be the only one enabled).
  • Click Edit.
  • Select Application pool identity if it is not selected.
  • Click OK.

 

 

(Visited 1,950 times, 1 visits today)

Leave a Reply