Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker: the requested PHP extension bcmath is missing from your system

Tags:

docker

bcmath

I am getting below error while installing bcmath

root@cfe90ea33de0:/var/www/web# apt install php-bcmath
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package php-bcmath is a virtual package provided by:
  php7.3-bcmath 7.3.14-1~deb10u1 [Not candidate version]
  php7.3-bcmath 7.3.11-1~deb10u1 [Not candidate version]
  php7.0-bcmath 7.0.33-0+deb9u7 [Not candidate version]
  php7.0-bcmath 7.0.33-0+deb9u6 [Not candidate version]

E: Package 'php-bcmath' has no installation candidate

I tried with below command still same error

apt-get install php7.3-bcmath
apt-get install php7.0-bcmath
V=`php -v | sed -e '/^PHP/!d' -e 's/.* \([0-9]\+\.[0-9]\+\).*$/\1/'` \apt-get install php$V-bcmath
like image 383
Jackson Avatar asked Mar 19 '26 12:03

Jackson


1 Answers

docker-php-ext-install bcmath

Above command works, after logged in to the Docker.

like image 81
Jackson Avatar answered Mar 22 '26 10:03

Jackson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!