new-logo-2024

IIS WP Image User Permissions

arrow_1.png

https://www.bluevalleytech.com/techtalk/blog/iis-500-errors-when-loading-a-static-image-in-wordpress.aspx

IIS 500 ERRORS WHEN LOADING A STATIC IMAGE IN WORDPRESS

I ran into this problem today and it was a frustrating one to track down. The WordPress site was a very basic blog running on IIS and using the freindly perma-links settings.
When loading a static image that had been uploaded in WordPress the browser would return a 500 error, and the IIS log would show: “GET /wp-content/uploads/2013/10/Sale.jpg – 80 – 192.168.0.133 Mozilla/5.0+(Windows+NT+6.2;+WOW64;+rv:24.0)+Gecko/20100101+Firefox/24.0 500 50 5 46”
I finally found the solution on another blog, posted by iis_isz.  I have copied the solution here to make sure I can find it again in the future, and for anyone else that has the same issue!

EXPLANATION OF THE ERROR

The image issue was a permission issue, but simply setting it manually on the original image file or parent folder is inadequate.  The behavior of WordPress is that it writes the original file using IUSR to a temporary system directory that is defined in the PHP.ini file.  This temp folder does not have IIS_IUSRS permissions on it, so when windows moves this file from the temp folder to the application’s upload folder, its final home, IIS_IUSRS only has read permissions, so the permissions are not inherited from the file’s parent folder.

TO FIX THIS, THERE ARE TWO SOLUTIONS

1. Change the permissions on the temp folder giving IIS_IUSRS write/modify.
2. Change the path of the temp folder in the PHP.ini file to a folder that does have IIS_IUSRS write/modify permission.
Here is a good source detailing the problem:
http://www.howyoudo.info/index.php/how-to-fix-windows-server-upload-file-inherit-permissions-error/
I chose to move the temp folder in my  and also give it permissions.
After uploading an image in wp-admin, I was able to access the image (original, not resized) from a browser wihout the 500.50 error.

Facebook
Twitter
Email
Print

Newsletter

Sign up our newsletter to get update information, news and free insight.

Latest Post