Doc #78998 [Opn->Ver]: Fatal error: Undefined class constant 'EM_AES_256'
| From: | cmb@php.net | Date: | Thu, 19 Dec 2019 11:23:47 +0000 |
| Subject: | Doc #78998 [Opn->Ver]: Fatal error: Undefined class constant 'EM_AES_256' | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17148@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78998&edit=1
ID: 78998
Updated by: cmb@php.net
Reported by: shariefjamiel at gmail dot com
Summary: Fatal error: Undefined class constant 'EM_AES_256'
-Status: Open
+Status: Verified
Type: Documentation Problem
Package: Zip Related
Operating System: ubuntu 18.04 - php 7.2.15
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
It can work on PHP 7.2, but you need >= 1.2.0[1].
[1] <https://libzip.org/documentation/zip_file_set_encryption.html>
Previous Comments:
------------------------------------------------------------------------
[2019-12-19 10:55:40] shariefjamiel at gmail dot com
Description:
------------
Here and other places says this works on PHP 7.2 and above, when infact it only works on 7.3 and
above.
- https://www.php.net/manual/en/zip.constants.php
- https://www.php.net/manual/en/ziparchive.setencryptionname.php
Test script:
---------------
$archive = new ZipArchive();
if ($archive->open('foo.zip', ZipArchive::CREATE)!==true) {
exit("cannot open $filename");
}
$value = ZipArchive::EM_AES_256; // error
$archive->setEncryptionName('foo', ZipArchive::EM_AES_256, 'foo'); // also
doesnt work
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78998&edit=1