I\'m having this code to zip files but i need to protect this file with a password
$file = \'backup.sql\'; $zipname = $file.\'.zip\'; $zip = new ZipArchive;
Since PHP 7.2 you can use setEncryptionName to create password protected ZIP archive.