views:

69

answers:

2

Strangely enough the server can't resize images any more because it doesn't have enough write permissions. When I check the permissions of the directory I want to write my resized images to I see:

username staff

After excecuting echo exec('whoami'); and checking the httpd.conf I saw the user and group for the server was daemon:daemon (this seems to be the default for Zend Server CE on an OSX installation). What should I do so I have enough permissions again. Should I chown my directory to daemon:daemon (what isn't working). Should I change the user of the server or something else?

A: 

I really depends on if you are using this in production in the wild or in private. If it were me, I would simply chown the directory for use with the server only. If you give access to that group, you will open up access to many more things.

cdburgess
A: 

IMHO there's no point in touching the web server user - it makes sense for Apache to run as a dedicated user and not have access to all your personal files.

The best way to solve this in my experience is to change the file's group to daemon and make it group-writable, but keep you the owner of the file so you can edit / delete it as well. On OS X terminal this is done by:

$ sudo chgrp daemon <file>
$ sudo chmod 664 <file>

Obviously replace <file> with the name of the file you want to give access to.

Another easy way out is to run chmod 666 on the file - make it world writable, but this is not recommended if you care about security in any way (might be ok on your own development environment but never in production or a shared environment).

Shahar Evron