PHP Extensions

Migrating from Heroku and managed to solve my first issue after migration with missing docker files, simply added them from your template for Laravel. Now I'm running into composer failure with PHP extensions Root composer.json requires PHP extension ext-imagick * for example. This is how they were defined for Heroku, how do you do this in Railway?
9 Replies
Percy
Percy2y ago
Project ID: N/A
Innominate
Innominate2y ago
N/A
Innominate
Innominate2y ago
What is the Railway equivalent or what am I missing?
Innominate
Innominate2y ago
GitHub
PHP ext-mongodb doesn't work · Issue #639 · railwayapp/nixpacks
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...
Innominate
Innominate2y ago
How do people use Railway with PHP if extensions don't work? What am I missing? Seems I still can't migrate from Heroku... Would love to start using Railway if anyone has a solution for this
Innominate
Innominate2y ago
Innominate
Innominate2y ago
#13 [stage-0 9/18] RUN composer install
#13 sha256:7ae72742a9e8c9711229c14da775c5c5a0887746bbd5afe83a48b496e2954a09

#13 0.434 Composer plugins have been disabled for safety in this non-interactive session. Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
#13 0.434 Do not run Composer as root/super user! See https://getcomposer.org/root for details
#13 0.507 Installing dependencies from lock file (including require-dev)

#13 0.516 Verifying lock file contents can be installed on current platform.
#13 0.543 Your lock file does not contain a compatible set of packages. Please run composer update.
#13 0.543
#13 0.543 Problem 1
#13 0.543 - Root composer.json requires PHP extension ext-imagick * but it is missing from your system. Install or enable PHP's imagick extension.
#13 0.543 Problem 2
#13 0.543 - Root composer.json requires PHP extension ext-redis * but it is missing from your system. Install or enable PHP's redis extension.
#13 0.543
#13 0.543 To enable extensions, verify that they are enabled in your .ini files:
#13 0.543 - /nix/store/ikyni8lpwm0zzfi8nrx8a8izy5ivwz6i-php-with-extensions-8.1.13/lib/php.ini
#13 0.543 You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
#13 0.543 Alternatively, you can run Composer with `--ignore-platform-req=ext-imagick --ignore-platform-req=ext-redis` to temporarily ignore these required extensions.
#13 ERROR: executor failed running [/bin/bash -ol pipefail -c composer install]: exit code: 2
-----
#13 [stage-0 9/18] RUN composer install
#13 sha256:7ae72742a9e8c9711229c14da775c5c5a0887746bbd5afe83a48b496e2954a09

#13 0.434 Composer plugins have been disabled for safety in this non-interactive session. Set COMPOSER_ALLOW_SUPERUSER=1 if you want to allow plugins to run as root/super user.
#13 0.434 Do not run Composer as root/super user! See https://getcomposer.org/root for details
#13 0.507 Installing dependencies from lock file (including require-dev)

#13 0.516 Verifying lock file contents can be installed on current platform.
#13 0.543 Your lock file does not contain a compatible set of packages. Please run composer update.
#13 0.543
#13 0.543 Problem 1
#13 0.543 - Root composer.json requires PHP extension ext-imagick * but it is missing from your system. Install or enable PHP's imagick extension.
#13 0.543 Problem 2
#13 0.543 - Root composer.json requires PHP extension ext-redis * but it is missing from your system. Install or enable PHP's redis extension.
#13 0.543
#13 0.543 To enable extensions, verify that they are enabled in your .ini files:
#13 0.543 - /nix/store/ikyni8lpwm0zzfi8nrx8a8izy5ivwz6i-php-with-extensions-8.1.13/lib/php.ini
#13 0.543 You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
#13 0.543 Alternatively, you can run Composer with `--ignore-platform-req=ext-imagick --ignore-platform-req=ext-redis` to temporarily ignore these required extensions.
#13 ERROR: executor failed running [/bin/bash -ol pipefail -c composer install]: exit code: 2
-----
Seems the extensions do get installed
copying path '/nix/store/vmwv46symgw9vq58c0k1bydirvjp1ing-php-redis-5.3.7'
So the problem is rather that composer doesn't recognise it
- Root composer.json requires PHP extension ext-redis * but it is missing from your system. Install or enable PHP's redis extension.
Want results from more Discord servers?
Add your server