I have a PHP-script in which I'm trying to unlink files from a directory. The files in this particular directory have been uploaded using FTP under a different account than the one Apache is running under.
PHP runs on the server using mod_php, so I assume PHP scripts are executed as the same user Apache is running as. Probably because of this, the unlink fails.
I am running Apache 2.2.3 with PHP 5.1.6 on CentOS. Most of this is administered by Plesk 8. I do have full access to the shell though.
I have tried to create a new group in which I put the FTP user and the Apache user. I then changed the GID of the files to that new group so that PHP should be able to unlink the files. No success.
I have read about options like suPHP en suEXEC, but my knowledge of those products is limited.
What would be the best way to be able to remove those files using a PHP script?