php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #78998 Fatal error: Undefined class constant 'EM_AES_256'
Submitted: 2019-12-19 10:55 UTC Modified: 2019-12-19 17:35 UTC
From: shariefjamiel at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Zip Related
PHP Version: Irrelevant OS: ubuntu 18.04 - php 7.2.15
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: shariefjamiel at gmail dot com
New email:
PHP Version: OS:

 

 [2019-12-19 10:55 UTC] 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



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-12-19 11:23 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2019-12-19 11:23 UTC] cmb@php.net
It can work on PHP 7.2, but you need >= 1.2.0[1].

[1] <https://libzip.org/documentation/zip_file_set_encryption.html>
 [2019-12-19 11:45 UTC] shariefjamiel at gmail dot com
Sorry I am not following you, neither on Docker ubuntu 18.04 nor Travis CI ubuntu 14 maybe, when I use PHP 7.2 this does not work. Only when I switch to PHP 7.3 does it work.
 [2019-12-19 11:48 UTC] shariefjamiel at gmail dot com
This is from TravisCI as well

$ php --version
PHP 7.2.15 (cli) (built: Feb 11 2019 23:22:17) ( ZTS )

Error: Undefined class constant 'ZipArchive::EM_NONE'
 [2019-12-19 17:07 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2019-12-19 17:07 UTC] cmb@php.net
> […] but you need >= 1.2.0[1].

Oops!  That should have been "but you need libzip >= 1.2.0".
Ubuntu 18.04 has only libzip 1.1.2-1.1 by default.
 [2019-12-19 17:34 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=348590
Log: Fix #78998: Fatal error: Undefined class constant 'EM_AES_256'
 [2019-12-19 17:35 UTC] salathe@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=74de81ca6c488b103f4995106209798754e425fd
Log: Fix #78998: Fatal error: Undefined class constant 'EM_AES_256'
 [2019-12-19 17:35 UTC] salathe@php.net
-Status: Verified +Status: Closed
 [2019-12-19 17:35 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2019-12-20 00:43 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=348616
Log: Fix #78998: Fatal error: Undefined class constant 'EM_AES_256'

Bug: https://bugs.php.net/78998 (Verified) Fatal error:  Undefined class constant 'EM_AES_256'
 [2019-12-20 00:54 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=348617
Log: sync with en.

Fix #78998: Fatal error: Undefined class constant 'EM_AES_256'

Bug: https://bugs.php.net/78998 (Verified) Fatal error:  Undefined class constant 'EM_AES_256'
 [2020-02-07 06:04 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=06d5ed87403eb49c0f8098a635e19328e94143c5
Log: Fix #78998: Fatal error: Undefined class constant 'EM_AES_256'
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=ea3b03b2273543584f2e7260d1e5362df4a253d6
Log: Fix #78998: Fatal error: Undefined class constant 'EM_AES_256'
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 13:01:27 2024 UTC