WordPress on IIS7 upload error

By Michael Alfaro on March 29, 2012
Share on Facebook0Tweet about this on TwitterShare on LinkedIn1Google+0

Got this error today with Gregg Helfman on a client site that is using IIS7 with WordPress: “Before you can upload your import file, you must fix the following error: Unable to create directory c:intepubsitename/wp-content/uploads/2012/03.  Is it’s parent directory writable by the server?”

In order to fix, we spent a few minutes trying permissions out until we went to the web to find out that “IUSR” had to have the permission to do the writing.  I found the solution here: http://www.iisworkstation.com/2010/02/wordpress-theme-upload-error-on-iis-7.html

There was this other article that helped clarify why also: http://www.php.net/manual/en/install.windows.iis7.php

“As you can see it says that php-cgi.exe was impersonating IUSR account for the write operation in this case. As soon as I gave write access to IUSR on the wp-content directory everything started to run smooth.

But what I really wanted to know was – Why is IUSR account coming into all this?
Answer: Time to go back to basics :)

When I noticed the process name once again, that is when it hit me. My machine is running PHP with Fast CGI and I have the following setting in my php.ini:


Which esentially means when fastcgi impersonation is enabled, PHP will perform all file system operations with the user id that is currently authenticated by IIS. In my case I was using Anonymous Authentication with default settings. Hence IUSR. “