Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Composer extensions installation

Ivo June 10, 2024

Hello guys, 

I need to install several docker dependencies for composer with my pipeline but I'm getting the errors below: 

+ composer install
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.
- Root composer.json requires PHP extension ext-amqp * but it is missing from your system. Install or enable PHP's amqp extension.
Problem 2
- Root composer.json requires PHP extension ext-bcmath * but it is missing from your system. Install or enable PHP's bcmath extension.
Problem 3
- php-amqplib/php-amqplib is locked to version v3.6.2 and an update of this package was not requested.
 
- php-amqplib/php-amqplib v3.6.2 requires ext-sockets * -> it is missing from your system. Install or enable PHP's sockets extension.
 
Problem 4
- php-amqplib/php-amqplib v3.6.2 requires ext-sockets * -> it is missing from your system. Install or enable PHP's sockets extension.
- php-amqplib/rabbitmq-bundle 2.16.0 requires php-amqplib/php-amqplib ^2.12.2|^3.0 -> satisfiable by php-amqplib/php-amqplib[v3.6.2]. 
- php-amqplib/rabbitmq-bundle is locked to version 2.16.0 and an update of this package was not requested.
To enable extensions, verify that they are enabled in your .ini files:
- /usr/local/etc/php/conf.d/docker-fpm.ini
- /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.

Alternatively, you can run Composer with `--ignore-platform-req=ext-amqp --ignore-platform-req=ext-bcmath --ignore-platform-req=ext-sockets` to temporarily ignore these required extensions.

 
I use php:8.2.20-fpm-bullseye because there is php 8.2 support. What I did so far is to try the installation with:

apt install  php8.2-amqp 

docker-php-ext-install amqp

How can I include and enable this dependencies to my pipeline?

pipeline script part: 
script:
- apt-get update && apt-get install -y php8.2-dev php8.2-amqp libfreetype6-dev libjpeg62-turbo-dev libpng-dev && docker-php-ext-install bcmath sockets
- curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
- composer self-update
- composer install
- ./vendor/bin/phpunit test
caches:
- composer


Regards,

1 answer

1 accepted

1 vote
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 12, 2024

Hi Ivo and welcome to the community!

Pipelines builds run in Docker containers. For every step of your build, a Docker container starts (the build container) using the image you have specified in your bitbucket-pipelines.yml file. The repo is cloned in this container, and then the commands of the step's script are executed.

Since you are using php:8.2.20-fpm-bullseye, the Docker container where your build runs uses the following Dockerhub image:

This Docker image is based on Debian 11 (bullseye), so the question is how you install these extensions in a Docker container that uses Debian 11.

I suggest reaching out to a PHP-specific forum for help with how to install these extensions in Debian 11.

You can then debug your pipeline locally using the following guide:

When you have a command and build that works locally following this guide, it should work in Pipelines as well.

Kind regards,
Theodora

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events