I\'ve been at this for a while. This actually worked one time, then never again. it simply does not create the zip file. The file does exist.
$zip = new
The ZipArchive::addFile() method accepts the path to the file as its first parameter.
Here, you are using :
$zip->addFile("/trash-icon.png", "/gabage.png");
Which means you are trying to add the /trash-icon.png file to your archive.
Are you sure this file exists ?
Note there is a / at the beginning of that file's path, which indicates it's an absolute path.
Maybe that / should be removed, to use a relative path ?