Your best friend for file transfer.Fetch
Fetch and establishing sitewide Wordpress file permissions (6 posts)
- Started 4 years ago by pcgs51
- Latest reply 3 years ago from Scott McGuire
I don't see how to do what I think I need in the "Fetch Help > Concepts > Permissions" Help files.
I have been developing a WordPress site in MAMP using my localhost on my Mac. I've been uploading to a remote server/shared hosting account to occasionally test the site online. Things were going great until this week.
My most recent edits to my MAMP/localhost site are not showing up after uploading them to the remote site. Specifically, my most recent edits to my customized CSS file, my recent changes to some of my WordPress pages via the content editor and most recent customizations to my widgets are not visible.
I have deleted all the WordPress files on the remote server and dropped all the data in my WordPress database files and re-uploaded all the WordPress files and re-imported with current database file. Done this several times. I have made sure that the site is pointing to the correct address in the wp_options table by making sure that "siteurl" and "home" are set to the correct remote domain url.
When logged into MAMP everything looks as it should. But when viewing my remote site these recent edits are not showing up.
I am using WordPress v3.0.3, MAMP 1.9.4 and Fetch 5.5.3. Upon inspection of my remote site files I see that my file permissions aren't set correctly and even if this doesn't fix things I think I need to get a handle on how to set them. I understand that files should be set to 644 and folders to 755.
I understand that setting folders to 755 does not change the files inside, which is a good thing. However, is there a simple way to grab the entire site and change the files to 644 and the folders to 755 without being forced to use Terminal (AKA command line)?
Also, can I set these permissions in localhost and expect the permissions to remain as set on the remote? I don't see a simple way to do this but can't imagine that there isn't a way to accomplish this. Not sure if this will fix my problem but I have to try everything and its information I need to learn anyway. Thanks.
Scott McGuire Administrator
Just to make sure I understand correctly, you want some way to set all the files you've uploaded to the server (including those inside folders) to 644, and all folders (including those inside other folders) to 755, is that correct?
And no, you cannot accomplish this by setting permissions on your Mac and then upload the files and folders - permissions are not preserved when uploading. When you upload a file, the server assigns its own default permissions to files and folders, ignoring the ones the files had on the local machine.
We may have a suggestion for you after you confirm what you want to do, but setting the permissions locally won't work.
THANK YOU SCOTT!
Good to know that permissions are not preserved from local to remote hosts.
To confirm my goals, YES, I would like to know if there is a way to globally establish permissions for all my files in WordPress to 644 and all my folders to 755 without having to dig down and open each directory and getting info on each one. It would be pure insanity to do it individually.
Not sure if this is even recommended for Wordpress installations. But was reading in the Wordpress forum that this is the general rule of thumb. I can't imagine there isn't a big fat explanation of best practices for this but the doc in the Codex while is says much says little to clear this up for me. Since I hoped to accomplish this with Fetch thought I'd ask here. Or should I use something like batChmod?
Looking forward to your reply.
Scott McGuire Administrator
Okay, thanks for the confirmation. We have an AppleScript that will set permissions of files and folders recursively, so that every file gets set to one set of permissions, and every folder gets set to another.
To get it, you should download the Fetch example scripts, which you can do using this link:
You want the "Recursive Set Permissions" script that is inside the Fetch Example Scripts folder.
To use it:
* Open Fetch, and connect to your server.
* Select the folder containing the files and folders whose permissions you want to set. You can select multiple files and folders if you want.
* Open the "Recursive Set Permissions" script.
* The script will open in the AppleScript editor. Click the "Run" button in the toolbar.
* The script will ask you the permissions value you want to apply to files, and then the permissions value you want to add to folders. Enter the desired values (the defaults should be 644 and 755, as you want).
* Then Fetch will get to work! It's best not to do other things with Fetch while the script is running.
Please let us know if you have further questions.
Thanks so much Scott! It took me a leap of faith for me to believe that this script would reach out to Fetch and establish the settings. It also took a bit of faith to trust that the script would stop on its own. WordPress has a lot more files in it than I realized and I almost thought the script was in an infinite loop. But sure enough it eventually stopped and all the files (I didn't check them all but a few) are now set to 644 and the folders are set to 755.
Other than being forced to use the Terminal, not sure what we would do without this wonderful fix. Anybody using WordPress certainly should use this.
Scott McGuire Administrator
You're very welcome, and I'm glad to hear you're all set.
Please let us know if we can be of any further assistance.
- Page 1