I have a question.
Server: VPS
System: Centos 6 + Plesk 11
save_mode = off;
Problem:
I have a script that creates folders for users.
mkdir(‘/var/www/vhosts/website.com/private/’.$user_id.’, 0755, true);
And true the Plesk API i create a ftp user for the new folder.
The problem is that my php script create the new whit the following group and user: apache(502)/503
The ftp users has no rights in this folder at all.
If i create folders true ftp the group and user are: 505/10000
2
Answers
It is because your PHP script is running in
mod_php
mode and executes underApache
user. The easiest solution would be to switch your site to run inFastCGI
mode, so that PHP script is running under your PHP user and there is no ownership conflict.The question is pretty old, but I found a solution so thought it might be helpful for someone.
Following commands needs to be executed using root access.
For details explanation you can view the link
http://www.ryanbelanger.com/wordpress-file-permissions/