Closed byungjikroh closed 4 years ago
Hello. The library uses the polyfill package "paragonie/random_compat". Check your composer.json file and the "replace" section for possible removal of the "paragonie/ andom_compat" library from the dependencies.
Thanks.
There was no "replace" section on composer.json. But I added "paragonie/ andom_compat" manullay with 'composer require paragonie/random_compat:\<9.99' and it is resolved.
Description
There is an error to set password under PHP 7 because it uses 'random_bytes' which is add in PHP 7
How to reproduce
$zipFile->setPassword('password')
Possible Solution
Use the depreciated 'randomBytes' function in src/Util/CryptoUtil.php for under PHP 7
Additional context
Fatal error: Call to undefined function PhpZip\IO\Filter\Cipher\WinZipAes\random_bytes() in /Applications/XAMPP/xamppfiles/htdocs/thecallcokr/vendor/nelexa/zip/src/IO/Filter/Cipher/WinZipAes/WinZipAesEncryptionStreamFilter.php on line 104