skip to Main Content

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


  1. It is because your PHP script is running in mod_php mode and executes under Apache user. The easiest solution would be to switch your site to run in FastCGI mode, so that PHP script is running under your PHP user and there is no ownership conflict.

    Login or Signup to reply.
  2. 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.

    cd /var/www/vhosts/yourdomain.com
    chown -R youruser:psacln httpdocs
    chmod -R g+w httpdocs/wp-content
    find httpdocs -type d -exec chmod g+s {} ;
    

    For details explanation you can view the link
    http://www.ryanbelanger.com/wordpress-file-permissions/

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search