CakePHP needs to change owner of temp folders like this: http://book.cakephp.org/2.0/en/getting-started.html#tmp-directory-permissions
# chown -R username app/tmp
When I use Apache with mod_php
, username must be apache
.
When I use Apache with mod_fcgid
, username must be myswebsiteuser
.
I need to make some tryouts to check the performance of the fcgid
vs. mod_php
. So When I switch the php type, I get tons of errors in minutes. I run script that changes owner of the folder from apache to mywebsiteuser, remove old temporary files and wait cakephp to create new ones with new user. I need to combine old and new log files also.
It seems like chown permits to set user groups. Is there a way to set "tmp" folders so they can be used in mod_php and mod_fcgid, without switching owners ?
(I own the server, it has CentOS and it has only one website. Also Plesk 11.5)
Similar: What are the right ownership & permissions to the CakePHP app/tmp folder for production?
First create a group:
Open the groups file:
In the last line there exists a line like this:
Look for the username of the mod_fcgid, if you website is mywebsite.com, then possibly it is "mywebsite".
You need to add 2 users to your new group "apache" and "mywebsite".
Now change owner and mod of the folders like this:
Now temp folder is both writeable by mod_php (apache) mod_fcgid (mywebsite).