如何使用php [duplicate]创建256位加密的zip文件

Possible Duplicate:
Create an encrypted zip archive with PHP

How to create zipped file with 256 bits encryption using PHP

If there is any example it'll be great

On Linux you can use 7zip to create AES encrypted zip files:

exec("7z a -p$PASSWORD -mem=AES256 -tzip $ZIP $SOURCE");

Courtesy of Nfabio from http://ubuntuforums.org/archive/index.php/t-1694923.html

Be sure to apply escapeshellarg().

Note: While this approach will work, but it is better not to call out to the shell with an embedded password. As of php 7.2, this will no longer be necessary because php now natively supports AES zip encryption.

As I remember, PHP zip classes(I saw)/extension don't support encryption, so for a portable solution I suggest you to: