Top Most Useful PHP Extensions

Top Most Useful PHP Extensions 1

PHP is one of the most popular programming languages and is widely used to build web applications. While most web hosts support PHP, not all of them can provide all the necessary PHP extensions to complete web development tasks. In this article, we will look at the different types of PHP extensions that are available on shared hosting.

Basic PHP extensions

Basic PHP extensions are included with a standard PHP installation and are available on most hosts. They provide the core functions of the language, such as file and string manipulation, session management, and database manipulation. Some of the more common base PHP extensions include:


MySQLi (from English MySQL Improved) is an extension of the relational database driver used in the PHP programming language to provide access to MySQL databases. MySQLi is an updated version of the PHP MySQL driver and brings various improvements to the database experience. The developers of the PHP programming language recommend using MySQLi when running MySQL server version 4.1.3 or later (they used the new feature). The main advantage of MySQLi is that so-called SQL injections can be eliminated using previously declared operations.

GD: an extension that allows you to work with graphics. PHP is not limited to creating only HTML pages. It also allows you to create and work with image files in various formats including GIF, PNG, JPEG, WBMP, and XPM. More conveniently, PHP allows you to stream the image directly to the browser. To do this, you need to compile PHP with the GD graphics library, which contains functions for working with images. Other libraries may be required to work with GD (depending on the image format you need to work with).

CURL: An extension that provides the ability to work with remote servers and transfer data using the HTTP protocol.

Database Extensions

Database extensions are included with a standard PHP installation, but some hosts may not support all database types. Some of the extensions that can be useful when working with databases on shared hosting include:

PDO: an extension that provides a universal interface for working with various types of databases. PDO in PHP extensions is about providing a data access abstraction layer, which means you can query and retrieve data using the same functions, no matter which database you use. PDO is not a database abstraction; it doesn’t rewrite SQL or mimic unavailable features.


PGSQL: an extension that allows you to work with PostgreSQL databases. Extensions are modules that supply extra functions, operators, or types. Many extensions are available in Compose PostgreSQL. To view the available extensions, select Browser then select a database from the available databases. In the side-bar menu for the database is a tab for Extensions which lists all of the available extensions.
sqlite: An extension that allows you to work with SQLite databases.

File extensions

File extensions provide the ability to work with the server’s file system. Some of the extensions that can be useful when working with shared hosting files include:

zip: an extension that allows you to create and unpack zip archives;
Another great PHP extensions is fileinfo: an extension that allows you to determine the type of files by their content. This extension can be enabled by default as of PHP 5.3.0. Before this time, fileinfo was a PECL extension but no longer maintained there. Windows users must include bundled php_fileinfo. The libmagic library can be bundled with PHP but include PHP specific changes. A patch against libmagic named libmagic.patch is maintained and may be found within a PHP fileinfo extensions source.


imagick: An extension that provides the ability to work with images.
Network Extensions
Network extensions provide the ability to work with network protocols and functions