IIS 8.5 PHP Cannot Upload File - Permission Denied

If you have problem of not able to upload file and the error log said: permission denied/Unable to create file at line 0 (something like that), here is my suggestion:

  1. Go to your IIS, right click your application and select: Edit Permission
  2. In the "Security" screen where you can select a list of users and set permission, try to find if you have a user group called IUSR or IIS_IUSR.
  3. If you don't have it, use "Add" to add them in
  4. Assign "Full control" for those two groups and click "OK"
  5. Now here comes to the crucial part: Since PHP will first upload your file to a temporary folder first, then copy the file from temp folder to destination folder.  THE TEMPORARY FOLDER MUST ALSO BE WRITABLE BY IIS!!!
  6. So find that temporary folder out, add permission in that folder to allow IUSR and IIS_IUSR to have "full control"
  7. That would be OK.
Hope that helps someone.

Comments

Popular posts from this blog

TCPDF How to show/display Chinese Character?

How to fix fancy box/Easy Fancybox scroll not work in mobile

Wordpress Load balancing: 2 web servers 1 MySQL without any Cloud services