It is possible to method to set php running under apache to produce folders using the folder possessed by who owns this program that produces it rather than being possessed by apache?

Using word press it produces new folders to upload into however these are possessed by apache.apache and never through the site that they're running in. This happens using ostickets. For the time being we must SSH in to the server and chmod the folder, however it would appear there will be a setting somewhere to override the possession outdoors associated with a program that will it.

One other way would be to place the apache user and also the "customer customers" inside a new group. Additional your directory should make use of the sticky bit SGID so each new file got the audience assignment for this new group. By doing this the webserver and also the "customer customers" can function using the files with no problems

[17:57] progman@proglap /tmp/test $ ls -al /tmp/test
total 9
drwxrwsr-x  2 root users   48 Apr  1 17:55 .
drwxrwxrwt 36 root root  9264 Apr  1 17:53 ..

As you can see your directory got the stick bit SGID and also the owner may be the "customers" group by which I (progman) am. No if another user adds personal files the audience instantly get set for this group

[17:55] proglap ~ # touch /tmp/test/x

This really is performed from root. Now we obtain:

[17:57] progman@proglap /tmp/test $ ls -la /tmp/test
total 9
drwxrwsr-x  2 root users   72 Apr  1 17:59 .
drwxrwxrwt 36 root root  9264 Apr  1 17:53 ..
-rw-r--r--  1 root users    0 Apr  1 17:59 x

As you can see the additional file comes from root, however the group is placed to users and by doing this I can take it off

[18:00] progman@proglap /tmp/test $ rm x
rm: remove write-protected regular empty file `x'? y
[18:01] progman@proglap /tmp/test $ ls -la /tmp/test
total 9
drwxrwsr-x  2 root users   48 Apr  1 18:01 .
drwxrwxrwt 36 root root  9264 Apr  1 17:53 ..

Bear in mind that you simply still have to alter the chmod if you wish to edit the file as rw-r--r-- is simply group read access. But altering the chmod, possibly even dealing with umask, is preferable to coping with root-access and taking advantage of chown.

In a roundabout way, no. You cannot "hand outInch possession of the file to a different user, unless of course you are root. You can investigate while using "AssignUserID" apache directive to pressure that one vhost to operate like a particular user/group. With this Apache/PHP would create any files using the appropriate possession

Safe_mode is switch on in your server. The function mkdir() produces folder with owner ("apache", "none", ..) that different from the current script owner. And scripts could not upload (move, copy) files into that folder with another owner (that's nothing like current script owner).

Disable safe_mode which could be work.

See http://php.internet/manual/en/features.safe-mode.php for particulars.

P.S. With enable safe_mode you cannot use chmod() function in php.

Take a look at PHP chown() function

To be sure with Marc B (However I can't election in the publish due to my status).

One "dark" option would be set permission to others use, look into the second parameter (mode) of mkdir function