Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I think this has something to do with ownership of the folders, but I have a php app that I am trying to get setup and I cannot install it because it tells me the permissions are not correct.

I set the permissions by doing chmod 2775 /var/www/htdocs -R

Then I did chown developer:www-data /var/www/htdocs -R

doing a ls -la /var/www/htdocs I get

-rw-r--r--  1 developer  www-data     1079 Apr  3 14:42 .htaccess
drwxr-sr-x 14 developer  www-data     4096 Apr  3 14:42 images
-rw-r--r--  1 developer  www-data    44512 Apr  3 14:42 index.php

but I still get that the files and folders are not writeable from the php install file. Can anyone point me in the right direction?

share|improve this question
    
Please post your error when you run script. –  cuonglm May 17 '13 at 1:55
    
PHP message: PHP Warning: mkdir(): Permission denied in class.somepage.php and file_put_contents(content/cache/skins/someskin/styles/ie7base.css): failed to open stream: Permission Denied and copy(content/cache/skins/someskin/images/menu_tree_node.gif): failed to open stream: Permission denied These are over and over for tons of files that are trying to install. –  john h. May 17 '13 at 2:02
    
Does your script require root permission to install? –  cuonglm May 17 '13 at 2:09
    
no. it has something to do with server setup. I can install this on a regular hostgator account, but on the linode ubuntu server, this gets messed up.. –  john h. May 17 '13 at 2:14

2 Answers 2

It looks like it's complaining about files somewhere other than /var/www/htdocs. Where are the directories content/cache/skins/someskin/styles/ and content/cache/skins/someskin/images/ located? Check the permissions on those. Is that where it's installing the files from? I suspect you extracted the files as one user then su/sudo to the development user to install and maybe that user doesn't have read permission on those files.

share|improve this answer
    
those are subfolders the /var/www/htdocs and the user who extrated the files is a member of the folder group and has no sudo privs. –  john h. May 17 '13 at 3:19

The listing shows, that the files you're referring to are owned by the user: developer and group: www-data. But the files are only writeable by the user and not by the group:

-rw-r--r--  1 developer  www-data     1079 Apr  3 14:42 .htaccess
drwxr-sr-x 14 developer  www-data     4096 Apr  3 14:42 images
-rw-r--r--  1 developer  www-data    44512 Apr  3 14:42 index.php

should look like:

-rw-rw-r--  1 developer  www-data     1079 Apr  3 14:42 .htaccess
drwxrwsr-x 14 developer  www-data     4096 Apr  3 14:42 images
-rw-rw-r--  1 developer  www-data    44512 Apr  3 14:42 index.php

for me it looks like you had a typo at:

chmod 2775 /var/www/htdocs -R

and only did:

chmod 2755 /var/www/htdocs -R
share|improve this answer
    
hmm. I changed it by running chmod 2775 /var/www/htdocs -R and still am getting permissions errors in php. example: FastCGI: server "/usr/lib/cgi-bin/php5-fcgi" stderr: PHP message: PHP Warning: mkdir(): Permission denied in ... –  john h. May 17 '13 at 10:58
    
can you post the output of a simple ìd and groups of the php script? like <?php print exec("id"); ?> and <?php print exec("groups"); ?>. FastCGI php scripts could run as different users, maybe this one does as well –  Meiko Watu May 17 '13 at 13:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.