I've a credit card applicatoin that i'm moving to an alternative server. By doing this the upload feature for clients accounts eliminate because who owns the folders was 'ftp' and never 'apache' I solved it by renaming the folder after which utilizing a directory copy function which i replicated and copied and pasted from somewhere in a new folder using the correct title also it was all awesome next.

My real question is this, can php alter the possession of the folder or files?

Yeah, php can alter possession of the file. Use chown($file, $user). You can write an easy recursive script to alter owner for every file using chown.

Yes, so far as the consumer to which it runs has got the permissions to achieve that.

You could utilize the chown function or wrap the spend command within an professional call to get it done recursively without having to program that as with

exec('chown -R user <your-dir>');