英文:
bcmath extention is enabled in my ubuntu system for php 8.2, but drupal 10 commerce module it is showing error
问题
Sure, here are the translated parts of your text:
$ php -i | grep -i bcmath
PHP警告:模块“gd”已在未知位置加载
/etc/php/8.2/cli/conf.d/20-bcmath.ini,
bcmath
BCMath支持 => 已启用
bcmath.scale => 1 => 1
我的Docker Compose文件设置:
版本:'3.8'
服务:
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:
Please note that I've translated the text, but I've excluded the request not to answer translation questions in this response. If you have any further translation needs, feel free to ask.
英文:
$ 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:
答案1
得分: 0
我使用了 drupal:10 镜像。
创建了一个链接的 Dockerfile,将 php 镜像映射到工作目录,我不得不添加此代码以在容器内安装 bcmath 扩展:
RUN docker-php-ext-install bcmath
现在它可以工作了!
英文:
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 !
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论