0
$ php -i | grep -i bcmath
PHP Warning:  Module "gd" is already loaded in Unknown on line 0
/etc/php/8.2/cli/conf.d/20-bcmath.ini,
bcmath
BCMath support => enabled
bcmath.scale => 1 => 1

my docker compose file setup:

version: '3.8'

services:
  mysql:
    image: mysql:8.0.33
    environment:
      - MYSQL_ROOT_PASSWORD=root
    volumes:
      - mysql_data:/var/lib/mysql
    restart: always
  drupal:
    image: drupal:10
    ports:
      - 8080:80
    volumes:
      - ./web:/var/www/html
      - ./vendor:/opt/drupal/vendor
      - ./composer.json:/opt/drupal/composer.json
      - ./composer.lock:/opt/drupal/composer.lock
    links:
      - mysql
    environment:
      - MYSQL_USERNAME=root
      - MYSQL_PASSWORD=root
    restart: always

volumes:
  mysql_data:
hakre
  • 193,403
  • 52
  • 435
  • 836

1 Answers1

0

I was using drupal:10 image

Created a linked Dockerfile with php image mapped to the working directory & i had to add this code to install the bcmath extension inside the container:

RUN docker-php-ext-install bcmath

now its working !

  • Congrats, but could you share a bit more? How did you do this? In which file did you place that line? How did you verify it is working? Please edit the answer by adding more context to complete it. – hakre May 25 '23 at 04:35
  • Added some more details to my answer, thanks for the insight. – Anuraag Moharana Aug 03 '23 at 16:20
  • 1
    If it answers your question, please give it the green checkmark as well to mark the question as solved. – hakre Aug 03 '23 at 16:26