wordpress and file permissions [Archive] - Glock Talk

PDA

View Full Version : wordpress and file permissions


mdehoogh
11-22-2010, 17:34
A friend of mine hosts my website on his server. It's nothing critical and I mostly use it as a "cloud" storage so that I can transfer files easily between computers without a flash drive.

I installed wordpress (blogging software) on it and was going to edit the stylesheet. Wordpress has a built in editor where I can change the code and it will rewrite it for me but it said that I would need to change the file permissions in order for it to work.

I have the wordpress files installed in the /blog/ subdirectory and when I log into cPanel, I can see the option to edit file permissions. When I click on the /blog/ directory, the permissions are set as such:

..............user..group..world
read..........x.......x.........x
write.........x
execute.....x.......x.........x
...............7.......5.........5

On the wordpress website there's a section that covers file permissions and it says "All files should be owned by your user account on your web server, and should be writable by your username. Any file that needs write access from WordPress should be group-owned by the user account used by the webserver." and "If you want to use the built-in theme editor, all files need to be group writable."

This leads me to believe that I should change the permissions so that GROUP has write access and should be 775 instead of 755. I'm not sure if I should change the permissions of the entire /blog/ directory or if I should move lower down the tree and just change permissions of the /style.css files and any other specific files that may need write permissions.

Linux3
11-22-2010, 19:29
First off, are you sure your username and group and the same as the /blog install?

Can you shell/ssh into the server? If so at the prompt type: id
This will return username and group name.

next, be sure you are in the /blog directory and type: ls -al

This will return a long list of all files and directories with the username and group.
Do they match?
Next:
ps -ef |grep httpd
or
ps -ef |grep apache
This will tell you if you own the daemon. You must.

I don't really understand why you would need 775 permissions as only one user will be writing to the directory. I know, I read these docs:
http://codex.wordpress.org/Changing_File_Permissions

Anything web facing should have it's permissions changed with great temerity. I would NOT start at the /blog level.

mdehoogh
11-22-2010, 20:10
I do not know how to shell/ssh into but then, I've never tried so I don't know if I'm actually unable to or if its just a matter of never trying it.

I have an FTP account that I use to upload files. For anything more involved than a simple upload/download, I log in by typing :2082 at the end of the domain to get into cPanel

I have one SQL database which I used for Wordpress. There are, however, two users for the database, "username_matthew" (which is my name) and "username_blog" and I do not remember which one I used to install Wordpress. Do you know a way I can find out which was used for the installation? I do see an option to re-install it and since I have no content on the blog, it wouldn't really inconvenience me to do that.

grokdesigns
11-24-2010, 10:44
I have one SQL database which I used for Wordpress. There are, however, two users for the database, "username_matthew" (which is my name) and "username_blog" and I do not remember which one I used to install Wordpress. Do you know a way I can find out which was used for the installation? I do see an option to re-install it and since I have no content on the blog, it wouldn't really inconvenience me to do that.
Open the 'wp-config.php' file in the directory you installed WP in. It will have DB name, username, password, etc.

mdehoogh
11-29-2010, 19:05
I got it figured out. I was able to contact my buddy who is hosting it for me and he said to just edit the permissions of the directory for that particular stylesheet. I changed it to full 777 permissions just to finish editing some stuff. After I got everything arranged I changed back to the default permissions.

Thanks