How to Install bcmath extension of PHP on CentOS?
Last Updated :
29 Nov, 2022
PHP offers various extensions to deal with different cases. BCMath is one of the PHP extensions which is an interface to the GNU implementation as a library of the Basic Calculator that deals with float values in PHP. This extension helps in implementing the function related to mathematics on the production server without any arbitrary precision errors. It allows calculations on numbers (represented in string format) of any size and precision.
Downloading and Installation of Php BCMath
We can use the "yum" package manager to install the "php bcmath" extension on CentOS7.
Follow the further steps to install php bcmath extension on CentOS
Step 1: First, use the yum package manager to update the existing packages to their latest version. Type the command below to update the packages.
sudo yum update -y
The command using yum package manager will give the output of the running update.
Step 2: Now we directly install the PHP's BCMath extension by typing the command below in the terminal.
sudo yum install php-bcmath
Once it executes we will get an output which is shown below
Output 1
Output 2
The above two screenshot shows the output of running the install bcmath command it will directly install the extension according to the version of the PHP installed in your system. Here in this case we have PHP 5.4.16 installed in our system. We can check the PHP version installed in our system by typing the commands below.
php --version
This command will display the output of the command to check PHP version.
Step 3: Once the installation is completed, type the command below to check the status of "apache/httpd" service.
service httpd status
The status of the apache server whether it is active or inactive.
Step 4: If the apache service is inactive, restart it by typing the command below.
service httpd restart
The command for starting the apache server is successfully running.
Similar Reads
How to Install php-devel on CentOS? PHP is a highly used programming language. It is widely used for website development purposes. Using HTML a simple webpage can be implemented. But using PHP will be more interactive with the users. Nowadays, PHP has many more options to install on many platforms. In PHP some packages are there. Thes
2 min read
How to Install PHP Extension in cPanel? PHP (Hypertext Preprocessor) is known as a broadly useful prearranging language that can be utilized to foster dynamic and intelligent sites. It was among the main server-side dialects that could be inserted into HTML, making it more straightforward to add usefulness to pages without expecting to ca
1 min read
How to Install IMAP Extension in PHP on MacOS? Imap stands for Internet Message Access Protocol, It is a protocol used by email clients to retrieve email messages from mail servers, It is an application layer protocol in the OSI model. Imap allows us to store our messages on servers so that they can be accessed from multiple devices, whereas POP
4 min read
How to Install PHP Extensions on Windows? PHP is a general-purpose server scripting language. It is a powerful and important tool for developing dynamic and interactive Web pages. It is widely used, free, fast, flexible, and pragmatic. After installing PHP and a web server on Windows, extensions are also needed because they provide added fu
2 min read
How to enable PHP's openssl extension to install Composer ? To perform the secure HTTPS transfers you will need to enable the openssl extension then you have to install the composer. In this article, we will cover the enabling openssl for XAMPP as well as WAMP one by one then we will install the composer. Enable openssl extension on XAMPP Enable openssl exte
3 min read