-1

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?

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
john h.
  • 135
  • 1
  • 5
  • Please post your error when you run script. – cuonglm May 17 '13 at 01: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 02:02
  • Does your script require root permission to install? – cuonglm May 17 '13 at 02: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 02:14

2 Answers2

0

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.

Isaac Freeman
  • 246
  • 1
  • 7
  • 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 03:19
0

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
Meiko Watu
  • 364
  • 3
  • 15
  • 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 `` and ``. FastCGI php scripts could run as different users, maybe this one does as well – Meiko Watu May 17 '13 at 13:07