, php , :
-rwxrwxrwx user user temp/
-rwxr-xr-x apache apache temp2/
-rw-r--r-- user user script.php
, script.php :
// this operation fails as PHP (running as apache) does not own "temp",
// despite having write permissions
rename('temp', 'temp.bak');
// this operation is successful as PHP owns "temp2"
rename('temp2, 'temp.bak');