Search code examples
wordpressiiswindows-server

Windows server file permissions for Wordpress


I have wordpress on my windows server. Pictures and files are uploading but when i trying to access these files the server showing up with

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

When I searched for error i found some solutions about IIS but it didn't work. Can anyone cross with this permission error? And what is the solution.

Thanks


Solution

  • When you upload a file, PHP sends the file to a temporary directory on your server's hard drive (usually C:\Windows\Temp) and then copies it over to the proper directory. Once the file has is initially put in the temporary directory, it gets the permissions of that directory. The problem is when Windows moves that file to the proper place, it keeps the temporary directory’s permissions, which can cause access problems.

    The way to fix this is to change the temporary directory to a folder within your WordPress installation, usually wp-content/upgrade.

    To do this, follow these directions:

    1. Find your php.ini file.
    2. Find the upload_tmp_dir line, and change it to the wp-content/upgrade folder.
    3. Browse to this folder and verify that the permissions are set properly.

    You should then have the ability to properly view all your images. You'll most likely need to select all the previous selected images, and change the owner of the files to the web folder owner. Then you should be good to go!