Wrong permissions when uploading file on WORDPRESS (Windows server 2012)
Asked Answered
T

4

5

I've recently moved my WP site from godaddy to a physical sever using windows server 2012 R2.

But I'm having problem uploading files using the Admin panel, After uploading the file, I can see it physically on the server (wp-content\upload\2017\10) But I can't see it on the website it self.

I can only see the file if I'm changing it permissions on the server it self.

I've changed the permissions to the folder, I gave full access to the relevant users. But still, it doesn't work for new files\pictures I'm uploading via the wp admin panel

Edit:
I've notice that every time I come to change the folder permissions the permissions under CREATOR OWNER are always empty, Is it Related ?

Thank you very much for the help

Transient answered 15/10, 2017 at 0:13 Comment(0)
F
7

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:

Find your php.ini file. Find the upload_tmp_dir line, and change it to the wp-content/upgrade folder. 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!

Fonseca answered 25/5, 2018 at 8:9 Comment(0)
S
1

If you can’t upload an image at all, it’s probably because you need to give the IUSR account Read/Write/Modify permission on your wp-content folder. This will allow you to upload, and do the WordPress & plugin updates.

Once you have done that, all you need to do is give the IIS_IUSRS group Read permissions on your “C:\Windows\Temp” folder.

Make sure to notice that the two permission changes you make are not for the same user/group. Give IUSR permissions on your wp-content folder and IIS_IUSRS permissions on your Windows temp folder.

Note: If you have edited your php.ini file and change the upload temp directory then you will need to give IIS_IUSRS group read permissions on that folder instead.

That should do it, or at least it worked for me.

http://chris.wastedhalo.com/2011/01/wordpress-upload-permissions-on-iis-7-fix/

Spaceman answered 14/12, 2017 at 15:50 Comment(0)
P
0

I find myself coming back to this question time after time when images I add to the Media Gallery don't have the correct permissions in the WordPress Uploads folder. Since I develop WordPress sites locally, it would be a pain to set permission on the Uploads folder every time I work on a new site.

To fix this, I created a folder "C:\Websites\Temp" without messing around with permissions or security settings, etc. Then in MAMP, I edited the php.ini template of the PHP version I was using for this site, php7.3.0.ini (File, Edit Tempate, PHP). I then set upload_tmp_dir to "C:\Websites\Temp":

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
upload_tmp_dir = c:\websites\temp

and voila, no more permission issues.

Puncheon answered 24/10, 2020 at 13:39 Comment(1)
Still working in 2022 with MAMP Pro 5.Puncheon
B
0

Well, a few years later, found this post. Tried it. Failed. Other solution is to assign a specific user to the site in IIS and apply the right permisions to the folder containing the site.

Brainwork answered 6/6, 2021 at 9:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.