libsodium and ext-sodium are absent in my Elastic Beanstalk PHP 8.2 platform

0

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

MrMySQL
gefragt vor 6 Monaten348 Aufrufe
1 Antwort
0
Akzeptierte Antwort

I've added this config in my app:

.ebextensions/libsodium.config

commands:
    command1:
      cwd: /tmp
      command: wget https://download.libsodium.org/libsodium/releases/LATEST.tar.gz
    command2:
      cwd: /tmp
      command: tar -xvzf LATEST.tar.gz
    command4:
      cwd: /tmp/libsodium-stable
      command: ./configure
    command5:
      cwd: /tmp/libsodium-stable
      command: make && make check
    command6:
      cwd: /tmp/libsodium-stable
      command: sudo make install
    command7:
      cwd: /tmp/libsodium-stable
      command: sudo pecl install -f libsodium
MrMySQL
beantwortet vor 6 Monaten
profile picture
EXPERTE
überprüft vor 2 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen