My checklist of PHP extensions used in Alpine docker image
Tags: php, docker, alpine, extension
Published: 2022-06-25 16:12:12

---
title: My checklist of PHP extensions used in Alpine docker image
published: true
description: A short summary of common used php-extensions in alpine docker image
tags: php, docker, alpine, extension

---

I use a `base-alpine-php` image to build micro-service. For most of my use cases, I am going to install the following packages, if I really need them:

#### optional, only if I need to read/parse XML documents
- php8-xml
- php8-xmlwriter
- php8-simplexml

#### optional, only if I need serve the application via FastCGI
- php8-fpm
- php8-session

#### optional, only if I need the communication with my favorite PostgreSQL
- php8-pdo
- php8-pdo_pgsql
- php8-pgsql

#### optional, only if I need debug the complex PHP project
- php8-xdebug

#### optional, only if I need compress the documents.
- php8-zlib
- php8-phar


| Package        | Description                                                                                                                                                | significance |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
| git            | `git` is required to install certain packages from source code                                                                                              |✅ must       |
| make           | `make` is required to build certain packages from source code                                                                                               |✅ must       |
| nano           | `nano` alternative lightweight editor in CLI                                                                                                               | optional     |
| htop           | a handy command-line tool that displays running processes on a Linux system in real-time                                                                   | optional     |
| curl           | `curl` is required to download certain packages                                                                                                            |✅ must       |
| openRC         | `OpenRC` is the init system used in alpine. The init system manages the services, startup and shutdown of the system.                                      |✅ must       |
| nginx          | `Nginx` (engine x) is an HTTP and reverse proxy server                                                                                                     | optional     |
| `php8`         | PHP engine version 8                                                                                                                                       |✅ must       |
| php8-apcu      | `APCu` is an in-memory key-value store for PHP. APC provides both opcode caching (opcache) and object caching.                                             |✅ must       |
| php8-ctype     | this extension checks whether a character or string falls into a certain character class according to the current locale                                    |✅ must       |
| php8-curl      | this extension supports PHP to download data using curl.                                                                                                    |✅ must       |
| php8-posix     | This module contains an interface to those functions defined in the IEEE 1003.1 (POSIX.1) standards document which are not accessible through other means. |✅ must       |
| php8-tokenizer | The tokenizer functions provide an interface to the PHP tokenizer embedded in the Zend Engine.                                                             |✅ must       |
| php8-iconv     | `iconv` converts a string from one character encoding to another                                                                                            |✅ must       |
| php8-intl      | It enables PHP programmers to perform UCA-conformant collation and date/time/number/currency formatting in their scripts.                                  |✅ must       |
| php8-json      | _PHP_ has these built-in functions to encode and decode _JSON_ data                                                                                              |✅ must       |
| php8-mbstring  | _Mbstring_ is an extension of _php_ used to manage non-ASCII strings. It is non-default and need to be enabled manually.                                   |✅ must       |
| php8-opcache   | Enables the opcode cache for the CLI version of _PHP_                                                                                                      |✅ must       |
| php8-openssl   | This extension binds functions of [OpenSSL](http://www.openssl.org/) library for symmetric and asymmetric encryption and decryption.                     |✅ must       |
| php8-pcntl     | Process Control support in PHP implements the Unix style of process creation, program execution, signal handling and process termination.                  |✅ must       |
| php8-dom       | The built-in _DOM_ parser makes it possible to process XML documents in _PHP_.                                                                             | optional     |
| php8-xml       | XML parser for PHP                                                                                                                                         | optional     |
| php8-xmlwriter | XML writer for PHP                                                                                                                                         | optional     |
| php8-fileinfo  | FileInfo functions module can guess a content type and encoding of a file                                                                           | optional     |
| php8-fpm       | FastCGI Process Manager is a primary _PHP_ FastCGI implementation containing some features (mostly) useful for heavy-loaded sites.                         | optional     |
| php8-pdo       | _PHP PDO_ is a database access layer that provides a uniform interface for working with multiple databases                                                 | optional     |
| php8-phar      | `phar`  is a very simple program for creating _phar_ files with CLI                                                                                        | optional     |
| php8-pdo_pgsql | _PDO_PGSQL_ is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to PostgreSQL databases.                            | optional     |
| php8-pgsql     | a PostgreSQL module for PHP engine                                                                                                                              | optional     |
| php8-xdebug    | Xdebug module for PHP                                                                                                                                      | optional     |
| php8-zlib      | This module enables you to transparently read and write gzip (.gz) compressed files                                                                        | optional     |
| php8-session   | The session-support in PHP consists of a way to preserve certain data across subsequent accesses.                                                              | optional     |
| php8-simplexml | a very robust _SimpleXML_ parser                                                                                                                           | optional     |
| php8-soap | The SOAP extension can be used to write SOAP Servers and Clients. It supports subsets of » SOAP 1.1, » SOAP 1.2 and » WSDL 1.1 specifications                                                                                                                          | optional     |