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.
No description
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:...
Jump to solution
8 Replies
josefryzi
josefryziOP3mo ago
For example platform.sh has some yaml config to allow extensions
Michal Saloň
Michal Saloň3mo ago
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.
josefryzi
josefryziOP3mo ago
@Michal I am using zerops.yml from your symfony recipe
Solution
Michal Saloň
Michal Saloň3mo ago
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):
zerops:
- setup: app
build:
buildCommands:
- composer install --optimize-autoloader --no-dev
- php bin/console asset-map:compile
- php bin/console cache:warmup
deployFiles: ./
cache:
- vendor
- composer.lock
envVariables:
APP_ENV: prod
run:
prepareCommands:
- sudo apk add php83-sodium
initCommands:
- php bin/console doctrine:migrations:migrate
envVariables:
APP_ENV: prod
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
zerops:
- setup: app
build:
buildCommands:
- composer install --optimize-autoloader --no-dev
- php bin/console asset-map:compile
- php bin/console cache:warmup
deployFiles: ./
cache:
- vendor
- composer.lock
envVariables:
APP_ENV: prod
run:
prepareCommands:
- sudo apk add php83-sodium
initCommands:
- php bin/console doctrine:migrations:migrate
envVariables:
APP_ENV: prod
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
josefryzi
josefryziOP3mo ago
@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-sodium
Michal Saloň
Michal Saloň3mo ago
Hi, all I can see in our errors is that your php bin/console cache:warmup failed with:
PHP Fatal error: Uncaught Symfony\Component\Dotenv\Exception\PathException: Unable to read the "/build/source/.env" environment file. in /build/source/vendor/symfony/dotenv/Dotenv.php:553
Stack trace:
#0 /build/source/vendor/symfony/dotenv/Dotenv.php(106): Symfony\Component\Dotenv\Dotenv->doLoad()
#1 /build/source/vendor/symfony/dotenv/Dotenv.php(149): Symfony\Component\Dotenv\Dotenv->loadEnv()
#2 /build/source/bin/console(31): Symfony\Component\Dotenv\Dotenv->bootEnv()
#3 {main}
thrown in /build/source/vendor/symfony/dotenv/Dotenv.php on line 553
PHP Fatal error: Uncaught Symfony\Component\Dotenv\Exception\PathException: Unable to read the "/build/source/.env" environment file. in /build/source/vendor/symfony/dotenv/Dotenv.php:553
Stack trace:
#0 /build/source/vendor/symfony/dotenv/Dotenv.php(106): Symfony\Component\Dotenv\Dotenv->doLoad()
#1 /build/source/vendor/symfony/dotenv/Dotenv.php(149): Symfony\Component\Dotenv\Dotenv->loadEnv()
#2 /build/source/bin/console(31): Symfony\Component\Dotenv\Dotenv->bootEnv()
#3 {main}
thrown in /build/source/vendor/symfony/dotenv/Dotenv.php on line 553
josefryzi
josefryziOP3mo ago
@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
Michal Saloň
Michal Saloň3mo ago
failed pipelines are sorted by ASC not DESC
They shouldn't be, not in https://app.zerops.io/service-stack/STACK_ID/deploy or in notifications. If they are, that could be a FE issue to be fixed, but I do see them in correct order. Let us know if you have any other issues 🙂

Did you find this page helpful?