I have an Elastic Beanstalk environment. The platform is PHP 8.2 running on 64bit Amazon Linux 2023/4.0.2
. In my composer file I have a dependency on ext-sodium
. I've noticed that sodium was added in AL2023 since version 2023.2.20230920. PHP platform version 4.0.2 uses AL2023 version 2023.2.20231016 which is even higher. My question is what I am missing in getting libsodium and php sodium extension while deploying my application?
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1
- lcobucci/jwt is locked to version 5.2.0 and an update of this package was not requested.
- lcobucci/jwt 5.2.0 requires ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
Problem 2
- lcobucci/jwt 5.2.0 requires ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
- lexik/jwt-authentication-bundle v2.19.1 requires lcobucci/jwt ^3.4|^4.1|^5.0 -> satisfiable by lcobucci/jwt[5.2.0].
- lexik/jwt-authentication-bundle is locked to version v2.19.1 and an update of this package was not requested.
I tried to enable extension by adding Elastic Beanstalk config file:
files:
"/etc/php.d/sodium.ini":
mode: "000755"
owner: root
group: root
content: |
extension=sodium.so
but no luck, I got next error:
[ERROR] An error occurred during execution of command [app-deploy] - [Install composer dependencies]. Stop running the command. Error: installing composer dependencies failed with error: Command /bin/sh -c composer.phar install --no-ansi --no-interaction --no-dev failed with error exit status 2. Stderr:PHP Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib64/php8.2/modules/sodium.so (/usr/lib64/php8.2/modules/sodium.so: cannot open shared object file: No such file or directory), /usr/lib64/php8.2/modules/sodium.so.so (/usr/lib64/php8.2/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0