How to install BC Math and configure PHP to use BC Math?

Life Sayings

Member
Registered
Joined
Nov 9, 2013
Messages
59
Points
8
I have a PHP script and it is requiring this

BC Math for PHP must be installed on server and PHP must be configured to use BC Math.
I am using Centos 6.x and Apache.

How to install BC Math and how to configure PHP to use BC Math?
 

AECHostingNet

Member
Registered
Joined
Apr 25, 2018
Messages
29
Points
3
Try yum install php-bcmath. Then restart apache. You can verify that it is installed and loaded by running php -m | grep bcmath.
 

Life Sayings

Member
Registered
Joined
Nov 9, 2013
Messages
59
Points
8
Life Sayings
Thanks, I run the command and it worked.

Code:
[root@myvps ~]# yum install php-bcmath
Loaded plugins: fastestmirror, security
Setting up Install Process
Determining fastest mirrors
epel/metalink                                            | 3.3 kB     00:00
 * epel: fedora.mirror.serversaustralia.com.au
base                                                     | 3.7 kB     00:00
base/primary_db                                          | 4.7 MB     00:03 ...
epel                                                     | 3.2 kB     00:00
epel/primary                                             | 3.2 MB     00:00
epel                                                                                                                   12516/12516
extras                                                                                                      | 3.4 kB     00:00
extras/primary_db                                                                                           |  26 kB     00:00 ...
mysql-connectors-community                                                                                  | 2.5 kB     00:00
mysql-connectors-community/primary_db                                                                       |  26 kB     00:00
mysql-tools-community                                                                                       | 2.5 kB     00:00
mysql-tools-community/primary_db                                                                            |  45 kB     00:00
mysql57-community                                                                                           | 2.5 kB     00:00
mysql57-community/primary_db                                                                                | 152 kB     00:00
updates                                                                                                     | 3.4 kB     00:00
updates/primary_db                                                                                          | 1.8 MB     00:00 ...
Resolving Dependencies
--> Running transaction check
---> Package php-bcmath.x86_64 0:5.3.3-49.el6 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-49.el6 for package: php-bcmath-5.3.3-49.el6.x86_64
--> Running transaction check
---> Package php-common.x86_64 0:5.3.3-49.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===================================================================================================================================
 Package                          Arch                         Version                            Repository                  Size
===================================================================================================================================
Installing:
 php-bcmath                       x86_64                       5.3.3-49.el6                       base                        40 k
Installing for dependencies:
 php-common                       x86_64                       5.3.3-49.el6                       base                       530 k

Transaction Summary
===================================================================================================================================
Install       2 Package(s)

Total download size: 569 k
Installed size: 3.0 M
Is this ok [y/N]: y
Downloading Packages:
(1/2): php-bcmath-5.3.3-49.el6.x86_64.rpm                                                                   |  40 kB     00:00
(2/2): php-common-5.3.3-49.el6.x86_64.rpm                                                                   | 530 kB     00:01 ...
-----------------------------------------------------------------------------------------------------------------------------------
Total                                                                                              286 kB/s | 569 kB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : php-common-5.3.3-49.el6.x86_64                                                                                  1/2
  Installing : php-bcmath-5.3.3-49.el6.x86_64                                                                                  2/2
  Verifying  : php-bcmath-5.3.3-49.el6.x86_64                                                                                  1/2
  Verifying  : php-common-5.3.3-49.el6.x86_64                                                                                  2/2

Installed:
  php-bcmath.x86_64 0:5.3.3-49.el6

Dependency Installed:
  php-common.x86_64 0:5.3.3-49.el6

Complete!
 
Latest Threads
Replies
0
Views
38
Replies
0
Views
174
Replies
0
Views
81
Replies
0
Views
75
Recommended Threads

Latest Hosting OffersNew Reviews

Sponsors

Tag Cloud

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top