PHP extensions ext-sodium required
Hey guys, my Symfony app fails on installing:
━━━━ ❌ composer install --optimize-autoloader ━━━━
Pipeline ID PxIzWB0uTVijUBNhn8FeAg
2024-11-18T23:01:24.228Z Problem 3
2024-11-18T23:01:24.228Z - lexik/jwt-authentication-bundle is locked to version v2.21.0 and an update of this package was not requested.
2024-11-18T23:01:24.228Z - lcobucci/jwt 5.3.0 requires ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
Did not find anything in yur docs about it.
Solution:Jump to solution
Yes, and since Symfony demo is, sadly, very simple, it does not need Libsodium.
Try this updated Symfony example
zerops.yml
(see addition of run.prepareCommands
):
```yaml
zerops:...7 Replies
For example platform.sh has some yaml config to allow extensions
Hi, if you are using alpine os (if you do not have specifiacally
os: ubuntu
you are), you need to have sudo apk add php82-sodium
in your prepareCommands
.
Our PHP has some most used libraries, but not all of them. We do add some more popular/requested libraries, but can't add all of them.
If you are using ubuntu
then you youst need to enable sodium extension.@Michal I am using zerops.yml from your symfony recipe
Solution
Yes, and since Symfony demo is, sadly, very simple, it does not need Libsodium.
Try this updated Symfony example
zerops.yml
(see addition of run.prepareCommands
):
@Michal I tried your setup (1), I tried add prepareCommands to build section instead of run (2), neither works:
zerops:
- setup: app
build:
base: [email protected]
prepareCommands:
- sudo apk add php83-sodium
buildCommands:
- composer install
- php bin/console cache:warmup
deployFiles: ./
cache:
- vendor
- composer.lock
envVariables:
APP_ENV: dev
run:
base: [email protected]
prepareCommands:
- sudo apk add php83-sodium
initCommands:
- php bin/console doctrine:migrations:migrate
envVariables:
APP_ENV: dev
TRUSTED_PROXIES: 127.0.0.1,10.0.0.0/8
DATABASE_URL: "${db_connectionString}/${db_dbName}?serverVersion=16&charset=utf8"
MAILER_DSN: "smtp://mailpit:1025"
documentRoot: public
still same error
AND in console I can see it still missing ext-sodiumHi, all I can see in our errors is that your
php bin/console cache:warmup
failed with:
@Michal my apologies, failed pipelines are sorted by ASC not DESC, I was confused - yess I will continue with deploy, we can mark as resolved, thnx