Hướng dẫn bcmath php extension cpanel

Skip to content

Install BCmath Extension in PHP

PHP offers various extensions to deal with different cases. BCMath is one of PHP extension which helps us while working with float values in PHP. In BCMath, BC Stands for Binary Calculator. In this article, we will see how to Install BCMath Extension in PHP on various platforms.

Hướng dẫn bcmath php extension cpanel

BC Stands for Binary Calculator

Install BCMath Extension in PHP – Windows

The installation of PHP extension in PHP is very simple. Open your active php.ini and look for the line extension=php_bcmath.dll. If that line is commented with ; at the start then you just need to remove that ; and restart apache will load this BCMath extension with PHP.

Install BCMath Extension in PHP – Ubuntu

To install PHP extension in Ubuntu you will need either root or sudo user access. We will see how BCMath extension can be installed on various versions of PHP.

PHP 5.6

sudo apt install php5.6-bcmath

PHP 7.0

sudo apt install php7.0-bcmath

Other PHP Version

sudo apt install php-bcmath

If you are not sure which version of PHP you are using then you can type php -v in your terminal and you will get a version of PHP installed.

If all the above method did not work for you then you can search for all available module which is related to PHP. Type apt-cache search php in your terminal and it will list all PHP modules and extension which are compatible with your PHP version.

Once an extension is installed using any of the above methods then you need to restart the apache server in order to load BCMath extension in PHP.

Install BCMath Extension in PHP – CentOS

Same as Ubuntu you will need root or sudo user access to install an extension in PHP.

PHP 5.6

sudo yum install php56u-bcmath

PHP 7

sudo yum install php7.0-bcmath

If above did not work for you then you can search for an available package for your PHP version using sudo yum search bcmath and it will show available bcmath package for your PHP installation.

After the extension is installed you need to restart apache using sudo service httpd restart and you are done with the installation of PHP BCMath extension.

In the next article, we will see what is the use of this PHP BCMath Extension while working with float values in PHP.

Experienced full stack freelance web developer with a track record of producing excellent results for 11+ years. Excellent communication and collaboration skills, managing with a team of 20+ people. I’m motivated to make a positive impact on your revenue through the customer web portal development project.

Recent Posts

  • Null Coalescing Assignment Operator in PHP 7.4
  • W3Layouts – Best Website Builder
  • Everything You Need to Know Concerning WordPress
  • Caution while working with float values in PHP
  • Install BCmath Extension in PHP
  • Facts about Magento You Should Know
  • Can HTML5 Boost VR Gaming?

FREE QUOTE

Do you need help with services? Request a free quote to get in touch.

  • #1

Trying to install a CMS and I keep getting an error and I read somewhere that I need to enable the tokenizer extension. How do I do this?

Nội dung chính

  • Current PHP versions
  • Opcode cachers
  • PHP loaders or encoders
  • PHP extensions
  • Legacy PHP versions
  • Opcode cachers
  • PHP loaders or encoders
  • PHP extensions

  • #2

Hi lappy, the tokenizer should be built-in by default starting from PHP 4.3.0.

What is your output of the following command from console or ssh?

Last edited: Dec 19, 2009

  • #3

Trying to install a CMS and I keep getting an error and I read somewhere that I need to enable the tokenizer extension. How do I do this?

tokenizer extension is installed by default. You can check by executing the command:

BTW, what error message you receive while installing the CMS?

  • #4

Thanks for your replies. I believe this happened when I was installing Joomla. I will try again and report back with the exact error message.

  1. cPanel & WHM Documentation
  2. EasyApache4
  3. PHP
  4. PHP Options

Last modified: August 24, 2022

Overview

This document lists the PHP options available in EasyApache 4.

Select the PHP extensions that you wish to use in WHM’s EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4) or use your package manager. For more information about how to install a PHP package, read our How to Locate and Install a PHP Version or Extension documentation.

EasyApache adheres to the php.net supported versions timeline. The profiles that we supply in WHM’s EasyApache 4 interface (WHM >> Home >> Software >> EasyApache 4) only provide PHP versions that php.net currently supports.

  • If your server runs AlmaLinux 8 you cannot use PHP 7.1 or earlier.
  • If your server runs Ubuntu, you cannot use PHP 7.2 or earlier.
  • Packages for unsupported versions of PHP will remain on the cPanel L.L.C. mirrors and servers, but we will not provide any further updates.

Note:

To determine which package installs a specific extension, use the repoquery command. Use the following command to run the query, where ea-php80-php-mysqli represents the extension that you wish to install:

repoquery -q --whatprovides 'ea-php80-php-mysqli' | sort -V | tail -1

Current PHP versions

Current versions of PHP include PHP versions 7.4, 8.0, and 8.1.

Unless otherwise noted, the following options support all current versions of PHP.

Opcode cachers

An opcode cacher improves the efficiency of your PHP applications but also uses more memory.

EasyApache 4 currently only supports the OPCache opcode cacher.

Warning:

  • Opcode caching programs are not compatible with the suPHP or CGI PHP handlers. The caching program either does not function, or functions incorrectly.
  • The system does not automatically configure OPCache. If you do not manually configure OPCache after you install it, it will provide no benefits.

PHP loaders or encoders

A PHP loader allows PHP to execute encoded applications. This ensures that others cannot access your code. You can use one of the following options to install a PHP loader on your web server:

  • SourceGuardian Loader
  • ionCube Loader 10 — You can only use ionCube 10 with PHP 7.4 and earlier.
  • ionCube Loader 11 — You can only use ionCube 11 with PHP 7.4.
  • ionCube Loader 12 — You cannot use ionCube 12 with PHP 8.0.

PHP extensions

PHP provides many built-in extensions. You can use these extensions to add functionality to your PHP applications or your web server.

  • argon2 — Argon2 password hashing algorithm.
  • bcmath — Arbitrary precision mathematics. The Default profile includes this extension.
  • bz2 — Read and write bzip2 (.bz2) compressed files.
  • calendar — Convert between different calendar formats. The Default profile includes this extension.
  • ctype — Check whether a character is a certain character class.
  • curl — Support for the Client URL library (cURL) . The Default profile includes this extension.

    Note:

    You must install the mod_http2 Apache module for HTTP/2 support.

  • date — Get the server date and time.
  • dba — Access Berkeley DB-style databases..
  • dbg — PHP debugger.
  • dom — Use the DOM API with PHP.
  • enchant — PHP binding for the Enchant spelling library.
  • exif — Parse image metadata.
  • fileinfo — Detect a file’s content type and encoding.
  • filter — Filter data by validating or sanitizing.
  • fpm — FastCGI Process Manager. The Default profile includes this extension.
  • ftp — FTP (File Transfer Protocol) support. The Default profile includes this extension.
  • gd — Create and manipulate image files. The Default profile includes this extension.
  • gettext — Native language support API.
  • gmp — Use GNU multiple precision library to work with arbitrary-length integers.
  • hash — Message digest (hash) engine.
  • iconv — Character set conversion. The Default profile includes this extension.
  • imap — Mail functions (SMTP, POP3, IMAP). The Default profile includes this extension. This extension conflicts with the recode extension.
  • intl — Internationalization wrapper for the ICU library.
  • json — JavaScript Object Notation (JSON). PHP 8.0 and later include JSON in the Core module.
  • ldap — Lightweight directory access protocol.
  • libxml — XML library for PHP.
  • litespeed — Litespeed SAPI. The Default profile includes this extension.
  • mbregex — Disable regular expression functions with multibyte character support
  • mbstring — Enhanced Chinese, Japanese, and other language support. The Default profile includes this extension.
  • mcrypt — Encryption support. The Default profile includes this extension. In PHP 7.2 and later, the mcrypt module only exists as a PECL extension.
  • mhash — Interface for the Mhash library.
  • mysqli — MySQL improved database access.
  • mysqlnd — MySQL native driver. The Default profile includes this extension. The mysqlnd module does not support old pre-MySQL 4.1 passwords.
  • odbc — Unified ODBC database support.
  • openssl — OpenSSL library interface.
  • pcntl — Unix-style process control.
  • pcre — Perl-compatible regular expressions.
  • pdo — PHP Data Objects (PDO) database support. The Default profile includes this extension.
  • pdo mysql — PDO MySQL support.
  • pdo_odbc — PDO ODBC support.
  • pdo_pgsql — PDO PostgreSQL support.
  • pdo_sqlite — Enable access to SQLite 3 databases.
  • pgsql — PostgreSQL DB support.
  • phar — Disable Phar functionality. The Default profile includes this extension.
  • posix — Extended POSIX support. The Default profile includes this extension.
  • pspell — Check the spelling of a word and offer suggestions.
  • readline — Interface for the GNU Readline library.
  • reflection — Reverse-engineer classes, interfaces, functions, methods, and extensions.
  • session — Session support for PHP.
  • shmop — Allow PHP to read, write, create, and delete Unix shared-memory segments.
  • simplexml — SimpleXML support.
  • snmp — SNMP (Simple Network Management Protocol) support.
  • soap — SOAP server and client support.
  • sockets — Raw socket support. The Default profile includes this extension.
  • sodium — The Sodium encryption library. This extension is only available for PHP 7.4 and later.
  • spl — Standard PHP library.
  • sqlite3 — SQLite version 3 database support.
  • sysvmsg — Enable System V messages support.
  • sysvsem — Enable System V semaphore support .
  • sysvshm — Enable System V shared memory support.
  • tidy — Tidy HTML formatter.
  • tokenizer — PHP tokenizer functionality.
  • xml — XML support. The Default profile includes this extension.
  • xmlreader — XML Pull parser.
  • xmlrpc — XMLRPC client and server support. This extension is only available for PHP 7.4 and earlier.
  • xmlwriter— XML writer extension.
  • xsl — XSL support.
  • zip — Read and write zip archives. The Default profile includes this extension.
  • zlib — Read and write gzip archives.

Legacy PHP versions

Legacy versions of PHP include PHP versions 5.4, 5.5, 5.6, 7.0, 7.1, 7.2, and 7.3.

Unless otherwise noted, the following options support all legacy versions of PHP.

Click to view...

Opcode cachers

An opcode cacher improves the efficiency of your PHP applications but also uses more memory.

EasyApache 4 currently only supports the OPCache opcode cacher.

Warning:

  • Opcode caching programs are not compatible with the suPHP or CGI PHP handlers. The caching program either does not function, or functions incorrectly.
  • The system does not automatically configure OPCache. If you do not manually configure OPCache after you install it, it will provide no benefits.

PHP loaders or encoders

A PHP loader allows PHP to execute encoded applications. This ensures that others cannot access your code. You can use one of the following options to install a PHP loader on your web server:

  • SourceGuardian Loader
  • ionCube Loader 4 — You cannot use ionCube Loader 4 with PHP version 7.0 or later.
  • ionCube Loader 5 — You cannot use ionCube Loader 5 with PHP version 7.0 or later.
  • ionCube Loader 6 — You cannot use ionCube Loader 6 with PHP version 7.1 or later.
  • ionCube Loader 10
  • Zen Guard Loader — You cannot use Zend Guard Loader with PHP version 7.0 or later.

Note:

  • The Apache information page incorrectly displays Zend Guard Loader as version 3.3. Your version of PHP determines the version of Zend Guard Loader that the system actually uses.

    • If you use PHP versions 5.5 or 5.6, EasyApache uses Zend Guard Loader version 7.0.
    • If you use PHP version 5.4, EasyApache uses Zend Guard Loader version 6.0.
  • The IonCube configuration file name varies based on the version of PHP that you use.

    • If you use PHP versions 5.4 or 5.5, IonCube uses the the ioncube.ini file.
    • If you use PHP version 5.6, IonCube uses the 01-ioncube.ini file.
  • You cannot use multiple versions of ionCube simultaneously.

PHP extensions

PHP provides many built-in extensions. You can use these extensions to add functionality to your PHP applications or your web server.

  • argon2 — Argon2 password hashing algorithm. This extension is only available for PHP 7.2 and later.
  • bcmath — Arbitrary precision mathematics. The Default profile includes this extension.
  • bz2 — Read and write bzip2 (.bz2) compressed files.
  • calendar — Convert between different calendar formats. The Default profile includes this extension.
  • ctype — Check whether a character is a certain character class.
  • curl — Support for the Client URL library (cURL) . The Default profile includes this extension.

Note:

You must install the mod_http2 Apache module for HTTP/2 support.

  • date — Get the server date and time.
  • dba — Access Berkeley DB-style databases..
  • dbg — PHP debugger. This extension is only available in PHP 7.0 and later.
  • dom — Use the DOM API with PHP.
  • enchant — PHP binding for the Enchant spelling library.
  • exif — Parse image metadata.
  • fileinfo — Detect a file’s content type and encoding.
  • filter — Filter data by validating or sanitizing.
  • fpm — FastCGI Process Manager. The Default profile includes this extension.
  • ftp — FTP (File Transfer Protocol) support. The Default profile includes this extension.
  • gd — Create and manipulate image files. The Default profile includes this extension.
  • gettext — Native language support API.
  • gmp — Use GNU multiple precision library to work with arbitrary-length integers.
  • hash — Message digest (hash) engine.
  • iconv — Character set conversion. The Default profile includes this extension.
  • imap — Mail functions (SMTP, POP3, IMAP). The Default profile includes this extension. This extension conflicts with the recode extension.
  • intl — Internationalization wrapper for the ICU library.
  • json — JavaScript Object Notation (JSON). PHP 8.0 and later include JSON in the Core module.
  • ldap — Lightweight directory access protocol.
  • libxml — XML library for PHP.
  • litespeed — Litespeed SAPI. The Default profile includes this extension.
  • mbregex — Disable regular expression functions with multibyte character support
  • mbstring — Enhanced Chinese, Japanese, and other language support. The Default profile includes this extension.
  • mcrypt — Encryption support. The Default profile includes this extension. In PHP 7.2 and later, the mcrypt module only exists as a PECL extension.
  • mhash — Interface for the Mhash library.
  • mssql — MSSQL® database access. This extension is only available in PHP 5.6 and earlier.
  • mysql — The original MySQL API database access. This extension is only available in PHP 5.6 and earlier.
  • mysqli — MySQL improved database access.
  • mysqlnd — MySQL native driver. The Default profile includes this extension. The mysqlnd module does not support old pre-MySQL 4.1 passwords.
  • odbc — Unified ODBC database support.
  • openssl — OpenSSL library interface.
  • pcntl — Unix-style process control.
  • pcre — Perl-compatible regular expressions.
  • pdo — PHP Data Objects (PDO) database support. The Default profile includes this extension.
  • pdo mysql — PDO MySQL support.
  • pdo_odbc — PDO ODBC support.
  • pdo_pgsql — PDO PostgreSQL support.
  • pdo_sqlite — Enable access to SQLite 3 databases.
  • pgsql — PostgreSQL DB support.
  • phalcon — Phalcon 3 extension support. This extension is only available for PHP versions 5.5 through 7.3.
  • phar — Disable Phar functionality. The Default profile includes this extension.
  • posix — Extended POSIX support. The Default profile includes this extension.
  • pspell — Check the spelling of a word and offer suggestions.
  • readline — Interface for the GNU Readline library.
  • recode — Interface for the GNU Recode library. This extension is only available for PHP 7.3 and earlier. It conflicts with the imap extension.
  • reflection — Reverse-engineer classes, interfaces, functions, methods, and extensions.
  • session — Session support for PHP.
  • shmop — Allow PHP to read, write, create, and delete Unix shared-memory segments.
  • simplexml — SimpleXML support.
  • snmp — SNMP (Simple Network Management Protocol) support.
  • soap — SOAP server and client support.
  • sockets — Raw socket support. The Default profile includes this extension.
  • spl — Standard PHP library.
  • sqlite3 — SQLite version 3 database support.
  • suhosin — Improves the security of PHP installations. This extension is only available for PHP 5.6 or earlier.
  • sysvmsg — Enable System V messages support.
  • sysvsem — Enable System V semaphore support .
  • sysvshm — Enable System V shared memory support.
  • tidy — Tidy HTML formatter.
  • tokenizer — PHP tokenizer functionality.
  • wddx — WDDX support. This extension is only available for PHP 7.3 and earlier.
  • xml — XML support. The Default profile includes this extension.
  • xmlreader — XML Pull parser.
  • xmlrpc — XMLRPC client and server support. This extension is only available for PHP 7.4 and earlier.
  • xmlwriter— XML writer extension.
  • xsl — XSL support.
  • zip — Read and write zip archives.
  • zlib — Read and write gzip archives.

Additional Documentation


  • EasyApache 4 Interface
  • MultiPHP INI Editor for WHM
  • MultiPHP Manager for cPanel
  • PHP Extensions and Applications Package
  • The rebuild_phpconf Script
  • The cPanel Glossary

cPanel, WebHost Manager and WHM are registered trademarks of cPanel, L.L.C. for providing its computer software that facilitates the management and configuration of internet web servers.