Programming

Preventing “500 Internal Server Error” for uploaded files on IIS PHP Sites

You may be getting “500 Internal Server Error” upon requesting a uploaded images of a wordpress / php website running on IIS7+ / Windows Server. This same error can be noted as url rewrite error on some debugging tools (developer tools) like chrome inspector. Also the same error can be noted as 500.50.

Nature of the Problem:

This is a very simple problem resulting because of the insufficient permission to read the requested file using the user which is running the PHP service on the windows server machine.

Solution:

For WordPress website

  1. Navigate to your WordPress site physical location
  2. Go to Wp-Content directory
  3. Right-Click uploads directory / folder and select ‘Properties’
  4. Go to ‘Security’ tab
  5. Click Edit
  6. Select ‘IUSR’ under group or user names
  7. Select ‘Read & Execute’ under permissions for IUSR
  8. Click ‘Apply’ and ‘Ok’
Correct Permission -uploads directory of WordPress on IIS
Correct Permission -uploads directory of WordPress on IIS

For Regular PHP websites

Follow the same procedures as the WordPress website. Note that the directory you need to give the permission to the ‘IUSR’ is the temporary directory specified in your ‘php.ini’ configuration file.

Previous ArticleNext Article