WordPress.org

Ready to get started?Download WordPress

Forums

Using MAMP Pro and changing file and directory permissions (11 posts)

  1. pcgs51
    Member
    Posted 3 years ago #

    Took me a while to find the right tutorial on how to use MAMP Pro for multiple hosts but finally found it here. However that doesn't solve all my problems.

    After installing WordPress, I tried to install a new theme and got a message that said I needed to change the permissions to 777. I don't recall what directory exactly the message indicated I needed to fix BUT what I do recall is that it wasn't the themes directory, it was attempting to install my theme into the uploads directory like it was a media upload. I also got a message telling me that one of my themes .css files needed to have the permissions set to 666. Arrrrgh!

    I have to assume (because I have no clue) that if the permissions were assigned properly that WordPress would have installed my theme into the themes folder with no problems. And that the .css message would not have appeared.

    Having stated all of the above—here's my real issue:

    After tons of searches I see that most people are saying to use the Mac OS "Get Info" to change things to "Write" by everyone and after installations, change them back. I have no idea if that is the equivalent of 777, 644 or 666 or whatever. I see other people suggesting using chmod via Terminal. To me that's a bit like shooting flies with a machine gun, especially since I use Terminal so seldom that it would take all day to figure it out each time. One method seems too stupid simple and the other is way overkill and these things make me nervous.

    Here are my questions:

    1. Is there a simple way to set permissions where I can see and choose the permissions values required and set them?
    2. If there is such a method, is there a utility application to help me do this? Remember this isn't FTP this is localhost. I tried setting this up in my FTP client with no luck (Fetch).
    3. Once I manage to change these permissions to upload or install plugins and themes do I really need to set them back to where I found them?
    4. Will these permissions affect the site when I transfer my files to my domain?

    Thank you.

  2. ClaytonJames
    Member
    Posted 3 years ago #

    Is there a simple way to set permissions where I can see and choose the permissions values required and set them?

    I've never tried this, but I've seen it recommended.. BatChmod

    Once I manage to change these permissions to upload or install plugins and themes do I really need to set them back to where I found them?

    Working locally without a functioning ftp server, you will need to download themes and plugins directly from your browser to your desktop and then simply extract them and place them in the themes or plugins directory. "Uploading" themes and plugins is simply going to be a copy and paste to /wp-content/themes or /wp-content/plugins.

    When you upload an image or any media library content for the first time using the media up-loader in the dashboard, wordpress might give you an "if the destination was writable" error. What it wants, is for the permissions on the wp-content directory to be writable (0777) so that it can create an uploads directory to store your media in. After it creates the uploads folder, you should be able to change the wp-content directory permissions back to 0755.

  3. pcgs51
    Member
    Posted 3 years ago #

    Thanks ClaytonJames!

    Yeah, I did find that installing manually was what would be needed but didn't realize that it would always be required. But that's no big deal.

    As for the very last part of your reply:

    you should be able to change the wp-content directory permissions back to 0755.

    Is that what I want to do, change the permissions back? IOW will I need to? I'm of the old school, "Just because you can doesn't mean you should."

    Wondering if it will foul up my files if I don't change them back before transferring to my site. Or if I need to leave them set because the permissions need to stay put.

    Thanks for the help. Grabbing BatChmod now.

  4. ClaytonJames
    Member
    Posted 3 years ago #

    Is that what I want to do, change the permissions back? IOW will I need to? I'm of the old school, "Just because you can doesn't mean you should."

    ...And just because you don't, doesn't mean you shouldn't. :-)

    I guess you don't really need to on your local installation because it isn't exposed to the web, and you aren't encountering other web space user accounts on your own machine, but you should do it on a live server. Correct file and directory permissions in a server environment are something you are going to want to attend to.

    Some reference material. Permission Scheme for WordPress

  5. pcgs51
    Member
    Posted 3 years ago #

    Thank you again ClaytonJames,

    I sort of understand this but probably mostly don't. I looked over the link you included and will no doubt read it a dozen times again. Since I'm a slow learner—I hope you will guide me a little bit more. Please let me know what you think of my speculations, below. I'm just trying to figure out how to proceed without screwing up too much.

    The first thing I'm beginning to wonder is how many places will I discover that the permissions will need to be changed? Something tells me that it may not matter and that I might not need to worry about changing permissions until I am confronted with a WordPress notification to fix them. Is that the best way to handle things?

    The second thing is when I do need to edit permissions, either put them back the way I found them once I no longer need to edit in that area or remember to restore them to their original state before uploading to the Web server.

    Are these best practices? Perhaps I am over simplifying things. But I hope not. Thanks.

  6. ClaytonJames
    Member
    Posted 3 years ago #

    Perhaps I am over simplifying things.

    Actually you're over complicating things a bit, but you are on the right track. General rule of thumb...

    WordPress Permissions: Files = 0644 directories = 0755

    The first thing I'm beginning to wonder is how many places will I discover that the permissions will need to be changed?

    Occasionally you will encounter an exception (such as when first creating the uploads directory ) or if you choose to use the wordpress editor in the dashboard to modify a theme file, then you will have to adjust permissions on the file you want to to edit, and put it back when you are done. The only other time I can think of that you may need to change a file permission is when you update or change permalinks. Then the .htaccess file needs to be temporarily writable so that WordPress can automatically update it. Then you change it back to 0644.

    The second thing is when I do need to edit permissions, either put them back the way I found them once I no longer need to edit in that area or remember to restore them to their original state before uploading to the Web server.

    If you are editing files on a live server, yes. Put the permissiosn back when you are done. When working locally, you can just navigate to the file you need to edit, and edit it directly with any text editor without changing permissions. Once WordPress is on a live server, files should be set at 0644 and folders, 0755, with the occasional exception as previously noted.

  7. pcgs51
    Member
    Posted 3 years ago #

    Thanks so much! I hope that others will benefit from this thread because it's rich information. I'm just about to upload my first time to the server once this next bit is solved.

    I just now encountered the .htaccess issue you mentioned as I tried to edit the permalinks when your email came through. I got this message:

    "If your .htaccess file were writable, we could do this automatically, but it isn’t so these are the mod_rewrite rules you should have in your .htaccess file."

    Just below that the page offers me some code to add to the aforementioned .htaccess file but I cannot find a .htaccess file on my local installation (I should be able to see and edit it using Text Wrangler). Wondering if maybe I need to create one? If I need to edit one, where might it be located? If I need to create one to which directory should I save it? Thanks!

  8. ClaytonJames
    Member
    Posted 3 years ago #

    .htaccess is actually a file extension. On 'nix systems - includes OSX - the file is hidden by default. You can usually find an option to view hidden files in the ftp clients menu.

    If you still don't find one after turning on the "view hidden files" option, you can create a blank one and save in the same directory where you installed WordPress.

    Change its permissions to 666 and let WordPress update the file, then you can change the permissions back to 644.

  9. pcgs51
    Member
    Posted 3 years ago #

    I do understand that it is a file extension. I've edited a few .htaccess files in the past (scary). And yes, I can see them and edit the permissions with my ftp client. Because my files are in MAMP, I don't know what the hostname should be to access my localhost site. And have no idea about what username and password to use unless its the ones for WordPress. I've been trying to figure that one out since last night.

    I can edit the permissions on all the other files in BatChmod. But cannot find a way to view .htaccess files with it. I can edit .htaccess files in Text Wrangler but cannot change permissions. I can see .htaccess files on a remote server with my FTP client but cannot figure out how to access files on a localhost. Yes, I tried declaring the hostname as localhost among other things. Didn't work.

    I have approached this with every tool I can think of but have no tool that will do what I need with the knowledge I possess. Suggestions, thanks?

  10. ClaytonJames
    Member
    Posted 3 years ago #

    cannot figure out how to access files on a localhost.

    Just navigate to the folder you installed wordpress in on your Mac, ( I want to say probably Applications > Mamp > htdocs > ) ...and please bear in mind that OSX is not my primary OS, and I don't have a Mac in front of me to confirm this, but...

    TextWrangler: "In open-file dialogs, hitting shift-command-period toggles the visibility of hidden files (dotfiles, chflags-hidden files). This is a Leopard or Snow Leopard shortcut that works in TextWrangler... "

    Or in the OSX directory browser: "click the magnifying glass below the file list, and choose "Invisible Items"

    I'm assuming you are using Leopard.

    [edit]

    Because my files are in MAMP, I don't know what the hostname should be to access my localhost site. And have no idea about what username and password to use unless its the ones for WordPress.

    That won't work locally because you aren't running a web-accessible ftp server on your Mac.

  11. pcgs51
    Member
    Posted 3 years ago #

    Thanks for hanging in there with me ClaytonJames!

    I couldn't just navigate to my localhost with my FTP client it doesn't work that way. However, the fog has lifted here. For the sake of others coming along after this information I will finish the story.

    I couldn't accept that changing permissions would be so difficult that I would have to open this app and that app to do little bitty aspects of this task and getting nowhere real fast. After all I'm on a MAC for heaven's sake and why would anyone ever bother with MAMP if it wasn't making life simpler?

    My FTP client is an old one but tried and true: Fetch. But I couldn't get it to see the localhost until I visited the Fetch message board. Couple of things to note:

    In OSX you need to turn on the "Sharing" system prefs to "File Sharing">then click Options> enable checkboxes for "Share files and folders for both using "AFP" and the one for "FTP"

    Then in my FTP client the shortcut setup is

    Hostname: localhost
    Username: your OSX user account ID
    Password: your OSX user account password
    Path: /Applications/MAMP/htdocs/sitefoldername

    This works if you installed MAMP without getting tricky. Actually I'm using MAMP Pro hence the "sitefoldername".

    Don't bother with the port number. Now you should be able to quickly access your localhost. The only reason one would need to access it is to change permissions easily with a UNIX equivalent numbers being visible. No chmod in Terminal required.

    Now I have a new set of problems with permalinks but I will save that for a new thread if I don't find a good solution on my own or in this forum. Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic