How To Install php-db on Kali Linux

In this tutorial we learn how to install php-db on Kali Linux. php-db is Database Abstraction Layer

Introduction

In this tutorial we learn how to install php-db on Kali Linux.

What is php-db

php-db is:

DB is a database abstraction layer providing:

  • an OO-style query API
  • portability features that make programs written for one DBMS work with other DBMS’s
  • a DSN (data source name) format for specifying database servers
  • prepare/execute (bind) emulation for databases that don’t support it natively
  • a result object for each query response
  • portable error codes
  • sequence emulation
  • sequential and non-sequential row fetching as well as bulk fetching
  • formats fetched rows as associative arrays, ordered arrays or objects
  • row limit support
  • transactions support
  • table information interface
  • DocBook and phpDocumentor API documentation

DB layers itself on top of PHP’s existing database extensions.

Drivers for the following extensions pass the complete test suite and provide interchangeability when all of DB’s portability options are enabled:

fbsql, ibase, informix, msql, mssql, mysql, mysqli, oci8, odbc, pgsql, sqlite and sybase.

There is also a driver for the dbase extension, but it can’t be used interchangeably because dbase doesn’t support many standard DBMS features.

DB is compatible with PHP 5 and PHP 7.

There are three methods to install php-db on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install php-db Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install php-db using apt-get by running the following command:

sudo apt-get -y install php-db

Install php-db Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install php-db using apt by running the following command:

sudo apt -y install php-db

Install php-db Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install php-db using aptitude by running the following command:

sudo aptitude -y install php-db

How To Uninstall php-db on Kali Linux

To uninstall only the php-db package we can use the following command:

sudo apt-get remove php-db

Uninstall php-db And Its Dependencies

To uninstall php-db and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove php-db

Remove php-db Configurations and Data

To remove php-db configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge php-db

Remove php-db configuration, data, and all of its dependencies

We can use the following command to remove php-db configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge php-db

Dependencies

php-db have the following dependencies:

References

Summary

In this tutorial we learn how to install php-db package on Kali Linux using different package management tools: apt, apt-get and aptitude.