folder permissions help!

General support questions including new installations
Post Reply
vivik
Posts: 4
Joined: 2010/09/02 05:54:15

folder permissions help!

Post by vivik » 2011/02/16 23:47:20

Hi guys,

I'm pretty new with linux so bear with me.

I'm having problems with file/folder permissions. This is my scenario and what i'm trying to do

i have

CENTOS 5.5 + LAMP and a website linked to apache. I'm trying to install phpmydirectory [url=https://www.phpmydirectory.com/]link[/url]. To install the application i have to set a folder called "files" and "defaults.php" write permission, 755 or 777. I've done this using chmod as well as chmod -R just to make sure. I check the folders after running the code and it seems to have the correct permission. However on the installation test i'm still getting
"Folder Permissions: Failed - defaults.php and all folders in /files/ must be writable."

Eventually i ignored this and continued with the installation and the site seems to work fine except that i can't upload images to the site. So i'm trying to figure out what i did wrong. I have already posted a similar question in phpmydirectory's forum but just hoping if you guys have any ideas? Maybe some settings i have to set in apache to allow uploads like in windows where you set a folder to have "network service" permissions?

thanks guys

hawaiian717
Posts: 178
Joined: 2009/01/30 19:58:25
Location: California

folder permissions help!

Post by hawaiian717 » 2011/02/17 01:44:34

You didn't say which permissions you set the "files" folder and "defaults.php" file to. 755 and 777 aren't nearly the same.

I'm not familiar with phpmydirectory, but I've run into similar issues with MediaWiki. My solution was to set the group ownership of the "images" directory (where MediaWiki stores uploaded files, sounds equivalent to the "files" folder) to "apache" (the group the Apache server runs under) and the permissions to 775, that is make the folder group writable. 777 should have a similar effect but is more dangerous since any user on the system would have write permissions.

You probably need to do something like this:

chgrp -R apache files
chgrp apache defaults.php
chown -R 775 files
chown 775 defaults.php

vivik
Posts: 4
Joined: 2010/09/02 05:54:15

Re: folder permissions help!

Post by vivik » 2011/02/17 04:24:44

thanks for the reply,

The manual for phpmydirectory says 755 should work but if not use 777. I don't really want to use 777...

anyway, finally got it to work... It seems 755 wasn't enough, so now i'm using 775. it seems i can upload pictures now, but in the setup process for phpmydirectory it still says folder permissions aren't writable??? oh well, as long as it works

Thanks

hawaiian717
Posts: 178
Joined: 2009/01/30 19:58:25
Location: California

Re: folder permissions help!

Post by hawaiian717 » 2011/02/17 05:17:38

For 755 to work, the files would have to be owned by the same user that Apache runs as. "chown apache" would work, but rather than do that I kept the ownership as is, and changed the group permissions instead.

Post Reply

Return to “CentOS 5 - General Support”