you could use PHP ZipArchive library to for you purpose.
also, an code example from the documentation you might find useful.
<?php
$zip = new ZipArchive();
$filename = "./test112.zip";
if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) {
exit("cannot open <$filename>\n");
}
$zip->addFromString("testfilephp.txt" . time(), "#1 This is a test string added as testfilephp.txt.\n");
$zip->addFromString("testfilephp2.txt" . time(), "#2 This is a test string added as testfilephp2.txt.\n");
$zip->addFile($thisdir . "/too.php","/testfromfile.php");
echo "numfiles: " . $zip->numFiles . "\n";
echo "status:" . $zip->status . "\n";
$zip->close();
?>
for changing the file permissions you can use PHP builtin function chmod.
for example
chmod("/somedir/somefile", 0600);
to delete the file you can use, php builtin unlink
for example,
unlink('test.html');
unlink('testdir');
I would strongly recommend yuo to go through the official PHP documentation.