Pages

Search This Blog

Thursday, October 10, 2013

Error Message 500 – Internal server error when try to access image uploaded into wordpress in IIS

When try to access to the photo / image that uploaded in WordPress that setup in IIS 7, Windows Server 2008 R2, error message below displayed:

Issue:

Server Error 

500 – Internal server error.
There is a problem with the resource you are looking for, and it cannot be displayed.




This is the big issue because all the uploaded image cannot displayed in the browser when click on it. Although we have granted the modify permission for user IUSR and {servername}\IIS_IUSRS to the directory and childdirectory /blog/wp-content/uploads/subdirectory but it still cannot be displayed.

Root Cause:
After check around, we found out that when we use PHP to upload a file. PHP will sends the file to a temporary directory on the hard drive (In my case C:\Windows\Temp) and then copies it over to it’s intended directory. You can find which one is the temporary folder by checking on the line “upload_tmp_dir” in php.ini.

Solution: 
Go to C:\Windows\Temp folder, grant “modify” permissions to both IUSR and {servername}\IIS_IUSRS user accounts.

It solve my problem.