nixpacks: PHP ext-mongodb doesn't work
Is there an existing issue for this?
- I have searched the existing issues
Describe the bug
In composer.json
I added "ext-mongodb": "*"
but it doesn’t seem to work.
╔══════════════════════════════ Nixpacks v0.10.3 ══════════════════════════════╗
║ setup │ php81, perl, nginx, php81Packages.composer, ║
║ │ php81Extensions.mongodb, nodejs-16_x, npm-8_x ║
║──────────────────────────────────────────────────────────────────────────────║
║ install │ mkdir -p /var/log/nginx && mkdir -p /var/cache/nginx ║
║ │ composer install ║
║ │ npm i ║
║──────────────────────────────────────────────────────────────────────────────║
║ build │ npm run prod ║
║──────────────────────────────────────────────────────────────────────────────║
║ start │ ([ -e /app/storage ] && chmod -R ugo+w /app/storage); perl ║
║ │ /assets/transform-config.pl /assets/nginx.template.conf ║
║ │ /nginx.conf && echo "Server starting on port $PORT" && (php-fpm ║
║ │ -y /assets/php-fpm.conf & nginx -c /nginx.conf) ║
╚══════════════════════════════════════════════════════════════════════════════╝
#1 [internal] load build definition from Dockerfile
#1 sha256:e5a244b29e12367aa92d8675e410338936275b825d055eacdacf51c1bd78cbd6
#1 transferring dockerfile: 967B done
#1 DONE 0.0s
#2 [internal] load .dockerignore
#2 sha256:c1396b312e04318d6ae56ea0d267fc748f7d2883ef70bd6d00c5d03592d3e432
#2 transferring context: 2B done
#2 DONE 0.0s
#3 [internal] load metadata for ghcr.io/railwayapp/nixpacks:debian-1665446966
#3 sha256:b26fad79f21ea01ca2434aedf5d5ca02963b551b28fc8871abd304c1b33fce51
#3 DONE 0.2s
#4 [ 1/12] FROM ghcr.io/railwayapp/nixpacks:debian-1665446966@sha256:48088795aef10698578d862349bf230f0ace63c978f31a686e1654ecbb78bf82
#4 sha256:ef597d3503bda54d84bcf75f737b8e4e845d514e363e95eb2c781a8d60a33f5c
#4 DONE 0.0s
#6 [internal] load build context
#6 sha256:298637ab6fc6c05ecfb0af2b006da3dcc073448cded58bfd921523d43adfc537
#6 transferring context: 78.49MB 0.8s done
#6 DONE 0.8s
#7 [ 3/12] COPY .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix
#7 sha256:3c65e9768bbb0619f0d54490f1ee81ef72b32140041bbe670d2964b2b70adc54
#7 CACHED
#8 [ 4/12] RUN nix-env -if .nixpacks/nixpkgs-a0b7e70db7a55088d3de0cc370a59f9fbcc906c3.nix && nix-collect-garbage -d
#8 sha256:9e6246995a82b9cbdaab7540419dff5694f202451eef0bec10bbb5e818812404
#8 CACHED
#5 [ 2/12] WORKDIR /app/
#5 sha256:ad8e7d0e819cbd274ef0b4e677c50dcca391cd8a4e78cc7cccbdc8a9c1d10c40
#5 CACHED
#9 [ 5/12] COPY .nixpacks/assets /assets/
#9 sha256:8b1fc55b3ac680e788867b50df1c2c8595f0674d788826f6f05d7f005e35d013
#9 CACHED
#10 [ 6/12] COPY . /app/
#10 sha256:7cc8b4f387b3a1850508db7747073990cce649cc636b5d7933658f77026f45e0
#10 DONE 0.4s
#11 [ 7/12] COPY . /app/
#11 sha256:345190d39c3d884e473f6ba013eb3a77b3d07662b799f1a7fa4ea10f86375b51
#11 DONE 0.5s
#12 [ 8/12] RUN mkdir -p /var/log/nginx && mkdir -p /var/cache/nginx
#12 sha256:15c7590a2f0875f7819d41d6c7ffe136c0c55ac7cb2cdb894c08fed3593c9ce1
#12 DONE 0.3s
#13 [ 9/12] RUN composer install
#13 sha256:482935d2aa081903d4233953d414ea6decb12fd4644bbdcff5b610f10736e203
#13 0.587 Do not run Composer as root/super user! See https://getcomposer.org/root for details
#13 0.656 No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
#13 0.657 Loading composer repositories with package information
#13 0.754 Info from [https://repo.packagist.org:](https://repo.packagist.org/) #StandWithUkraine
#13 5.485 Updating dependencies
#13 5.609 Your requirements could not be resolved to an installable set of packages.
#13 5.609
#13 5.609 Problem 1
#13 5.609 - Root composer.json requires PHP extension ext-mongodb * but it is missing from your system. Install or enable PHP's mongodb extension.
#13 5.609 Problem 2
#13 5.609 - mongodb/mongodb[1.11.0, ..., v1.11.x-dev] require ext-mongodb ^1.12.0 -> it is missing from your system. Install or enable PHP's mongodb extension.
#13 5.609 - mongodb/mongodb[1.12.0, ..., v1.12.x-dev] require ext-mongodb ^1.13.0 -> it is missing from your system. Install or enable PHP's mongodb extension.
#13 5.609 - mongodb/mongodb[1.13.0-beta1, ..., 1.14.x-dev] require ext-mongodb ^1.14.0 -> it is missing from your system. Install or enable PHP's mongodb extension.
#13 5.609 - jenssegers/mongodb[v3.9.0, ..., v3.9.2] require mongodb/mongodb ^1.11 -> satisfiable by mongodb/mongodb[1.11.0, ..., 1.14.x-dev].
#13 5.609 - Root composer.json requires jenssegers/mongodb ^3.9 -> satisfiable by jenssegers/mongodb[v3.9.0, v3.9.1, v3.9.2].
#13 5.609
#13 5.609 To enable extensions, verify that they are enabled in your .ini files:
#13 5.609 - /nix/store/jkh6n7m0dx88kj1mvn7kmpf7pfpiafh3-php-with-extensions-8.1.9/lib/php.ini
#13 5.609 You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
#13 5.609 Alternatively, you can run Composer with `--ignore-platform-req=ext-mongodb` to temporarily ignore these required extensions.
#13 ERROR: executor failed running [/bin/bash -ol pipefail -c composer install]: exit code: 2
------
> [ 9/12] RUN composer install:
To reproduce
No response
Expected behavior
No response
Environment
Ubuntu 22, Nixpacks 0.11.5
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 23 (5 by maintainers)
If you are testing on Railway, the version isn’t out yet and hasn’t been deployed on Railway.
It is live as of now.
Was a credential issue with Docker. Did
rm ~/.docker/config.json
followed bydocker login
and the error is gone, if anyone experience the same issue.What does your
composer.json
look like?In the meantime can you try installing the php81Extensions.mongodb Nix package.
Can set the environment variable
NIXPACKS_PKGS=php81Extensions.mongodb