Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZipArchive::setEncryptionName is not defined (ziplib is not up to date) #83

Closed
Stadly opened this issue Nov 5, 2018 · 3 comments
Closed

Comments

@Stadly
Copy link

Stadly commented Nov 5, 2018

ZipArchive::setEncryptionName should have been available since PHP 7.2. However, I get the error Call to undefined method ZipArchive::setEncryptionName() when using the function.

When checking out phpinfo, I see that libzip version 1.1.2 is used. Research indicates that this must be increased to version 1.2.0.

Expected Behavior

ZipArchive::setEncryptionName() should be defined.

Current Behavior

ZipArchive::setEncryptionName() is not defined.

Possible Solution

Update libzip to version 1.2.0 or newer.

Steps to Reproduce (for bugs)

$zip = new ZipArchive();
if ($zip->open('test.zip', ZipArchive::CREATE) === TRUE) {
    $zip->setPassword('secret');
    $zip->addFile('text.txt');
    $zip->setEncryptionName('text.txt', ZipArchive::EM_AES_256);
    $zip->close();
    echo "Ok\n";
} else {
    echo "KO\n";
}

Your Environment

  • Version used: thecodingmachine/php:7.2-v1-apache-node10
  • Operating System and version: Windows 10
@moufmouf
Copy link
Member

moufmouf commented Nov 7, 2018

I see. I can reproduce the problem and indeed, the problem comes from libzip.

I'm not sure how to install a more recent version of libzip "cleanly" on the image.
The base image is a "debian stretch".

I know libzip is in version 1.3 in the experimental version of debian, but not in stretch (according to https://tracker.debian.org/pkg/libzip)

Have you got any idea how I could install libzip 1.2 on Debian stretch?

@Stadly
Copy link
Author

Stadly commented Nov 9, 2018

Sorry, I've got no idea :-/

@mistraloz
Copy link
Collaborator

I closed it because it has not had recent activity.
Please, reopen if you need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants