问题
Have upgraded my php version from 5.6 to 7.2 but i dont see new php functions like setEncryptionName for ZipArchive class. i confirm this by echoing get_class_methods('zipArchive'). Do i need to do anything else in order to use the new set of functions the newer php version provides? Please help.
回答1:
The ZipArchive
class is part of the zip PECL extension for PHP
You will need version 1.14.0 is higher for the setEncryptionName()
function
See changelog here: https://pecl.php.net/package/zip/1.14.0
The zip extension depends on libzip >= 1.2.0
NOTE: many Linux distributions ship an older version of libzip. You might be able to find a newer version here: https://libzip.org/packages/ Otherwise you will need to compile it yourself.
来源:https://stackoverflow.com/questions/52693230/php-7-2-ziparchive-class-not-having-setencryptionname-function