• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Apache can't create files under user permissions

F

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?
 
Agreed

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:

http://forum.swsoft.com/showthread.php?s=&threadid=24767&highlight=ownership+php

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

Jordan
 
Is this problem particular to FreeBSD 4.9 and Apache 1.3 or it is global Plesk problem with permissions ?
 
Originally posted by Flintus
Is this problem particular to FreeBSD 4.9 and Apache 1.3 or it is global Plesk problem with permissions ?

It's not the Plesk problem, it's the inherent problem of PHP
 
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?
 
Originally posted by Flintus
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?

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.
 
Back
Top