Most of the time people iterate over a directory with 'opendir' or 'readdir' to add files to a zip. Like...
while ($file = readdir($dir)) { ... $zip->addFile($file) }
Note that $zip->addFile($file) will only work in the current directory if your at the root. You will need to add the correct path to that $file string variable to have the full file name like ...
$zip->addFile($dir . DIRECTORY_SEPARATOR . $file); will work.
This may identify why you may get a read error when closing the file.
Enjoy.