How to install bcmath in Ubuntu for PHP 7.1

◇◆丶佛笑我妖孽 提交于 2019-11-30 14:56:49

问题


I'm using an Ubuntu 16 server for testing with php7.1. One of my app uses bcadd function. I know that I need to install bcmath module for that but I'm unable to find php7.1-bcmath. When I tried to install apt install php-bcmath, it simply installed php7.0-bcmath module.

I was unable to find php7.1-bcmath module anywhere to install on my server. Does anybody has an idea?

apt install php7.1-bcmath returned following,

E: Unable to locate package php7.1-bcmath

E: Couldn't find any package by glob 'php7.1-bcmath'

E: Couldn't find any package by regex 'php7.1-bcmath'

回答1:


Answering my own question. Managed to fix this issue with following repo update.

add-apt-repository ppa:ondrej/php
apt update
apt install php7.1-bcmath

Restart apache and all good to go.




回答2:


install this : https://packages.ubuntu.com/fr/artful/amd64/php7.1-bcmath/download

add this :

deb http://security.ubuntu.com/ubuntu artful-security main universe

to /etc/apt/sources.list

$ sudo apt update

$ sudo apt install php7.1-bcmath


来源:https://stackoverflow.com/questions/43905580/how-to-install-bcmath-in-ubuntu-for-php-7-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!