1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Apache can't create files under user permissions

Discussion in 'Plesk for Linux - 8.x and Older' started by Flintus, Apr 10, 2006.

  1. Flintus

    Flintus Guest

    Plesk 7.5.4, FreeBSD 4.9

    Problem description:
    When users use php scripts creating/uploading files, the files are owned by apache:psacln while they should be owned by userid:psacln

    How can this problem be fixed?
  2. jas8522

    jas8522 Basic Pleskian

    Feb 3, 2005
    Likes Received:
    Halifax, Nova Scotia Canada

    I hear ya... it's annoying because your clients then cannot delete or edit files that have been uploaded through web based scripts.

    You could set up a cron job to chown <usr>:psacln everything in their dir, but this isn't a very good fix, and is specific to each user.

    This is what you need to do:


    I'm on RHEL3, going to try the RPM for suPHP

    Apparently this is not compatible with using .htaccess to specify php values, and since many of our clients do this, I cannot use suPHP. :S

  3. Flintus

    Flintus Guest

    Is this problem particular to FreeBSD 4.9 and Apache 1.3 or it is global Plesk problem with permissions ?
  4. dm__@

    dm__@ Guest

    It's not the Plesk problem, it's the inherent problem of PHP
  5. Flintus

    Flintus Guest

    Is it inherent of PHP4 or PHP5 too ?

    Is this problem inherent of FreeBSD or Linux too ?

    When adding/editing files via admin interface (php5) permissions are set correctly. Does admin interface use chown command?
  6. dm__@

    dm__@ Guest

    Plesk admin interface? Yes, it uses chown command (through the suid wrapper to gain root privileges).

    It is inherent problem of mod_php (both 4 and 5, both Linux and FreeBSD): everything is being executed with apache privileges, and for using chmod (or creating files belonging to other users) you need root privileges.

    Only the way to make it work properly is to use suEXEC with PHP-CGI or non-trivial setup of FastCGI PHP (I know the FastCGI solution is theoretically possible, but don't know whether it was implemented in practice).

    Sad things are: such setup requires BUNCH of system resources, and Plesk does not support it.