Undefined class constant 'EM_AES_256' when installing laravel-backup #1247
Replies: 6 comments 4 replies
-
More info: Here https://www.php.net/manual/en/zip.constants.php Says ZipArchive::EM_AES_256 (int) So this condition depends on how the extension was compiled. It's problematic because running composer dump-autoload in production breaks the system even if the feature is not used. I wonder if an isset(constant) in the package could work 🤔 |
Beta Was this translation helpful? Give feedback.
-
Constant introduced in: Not present in: I made a if in a fork of 6.15.0 with the fix (but I don't know how to PR into 6.15.1 or something like that) |
Beta Was this translation helpful? Give feedback.
-
This was problematic because locally I made composer update and it worked. Tests passed. Then CI/CD worked But production broke the entire app because autoload couldn’t be generated. |
Beta Was this translation helpful? Give feedback.
-
Running into the same issue with customers on a production instance in cPanel. It just needs to be rebuilt? I'll try that out and report back. |
Beta Was this translation helpful? Give feedback.
-
If you got here with same problem, temporary solution: in your composer.json use |
Beta Was this translation helpful? Give feedback.
-
Hello, @freekmurze can the fix for #1254 be backported to v6 with support for PHP 7.3? |
Beta Was this translation helpful? Give feedback.
-
What happened
when I do
composer require spatie/laravel-backup
I getUndefined class constant 'EM_AES_256'
The environment
Ubuntu Server
PHP 7.4.15
Composer version 2.0.9
My guess
I guess it's something wrong about zip extension.
However it seems to be present:
Now, check this out:
class exists:
but constant doesn't:
more info:
any ideas?
Beta Was this translation helpful? Give feedback.
All reactions