Skip to content

Instantly share code, notes, and snippets.

@chronon
Created February 18, 2017 15:38
Show Gist options
  • Save chronon/95911d21928cff786e306c23e7d1d3f3 to your computer and use it in GitHub Desktop.
Save chronon/95911d21928cff786e306c23e7d1d3f3 to your computer and use it in GitHub Desktop.
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
interbase
intl
json
ldap
mbstring
mcrypt
mysqli
oci8
odbc
opcache
pcntl
pdo
pdo_dblib
pdo_firebird
pdo_mysql
pdo_oci
pdo_odbc
pdo_pgsql
pdo_sqlite
pgsql
phar
posix
pspell
readline
recode
reflection
session
shmop
simplexml
snmp
soap
sockets
spl
standard
sysvmsg
sysvsem
sysvshm
tidy
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
@robsonvn
Copy link

<3

@mostafabarmshory
Copy link

<3

@asiby
Copy link

asiby commented Jan 20, 2020

Nice. Since some of them require custom installation steps, I will be adding those steps as I find them.

@asiby
Copy link

asiby commented Jan 20, 2020

Instaling php-gd

RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
    && docker-php-ext-configure gd \
    && docker-php-ext-install -j$(nproc) gd

@chronon
Copy link
Author

chronon commented Jan 20, 2020

@asiby Great idea to share some of the extra steps - below is my version of gd and a couple of others.


Reminder: combine these into a single RUN command if using more than one.

extension: gd

RUN apt-get update \
	&& apt-get install -y \
		libfreetype6-dev \
		libpng-dev \
		libjpeg-dev \
	&& docker-php-ext-configure gd \
		--with-freetype-dir=/usr/include/ \
		--with-jpeg-dir=/usr/include/ \
		--with-png-dir=/usr/include/ \
	&& docker-php-ext-install -j$(nproc) \
		gd \
	&& apt-get purge -y \
		libfreetype6-dev \
		libpng-dev \
		libjpeg-dev

extension: intl

RUN apt-get update \
	&& apt-get install -y \
		libicu-dev \
	&& docker-php-ext-install -j$(nproc) \
		intl \
	&& apt-get purge -y \
		libicu-dev

extension: imap

RUN apt-get update \
	&& apt-get install -y \
		libc-client-dev
		libkrb5-dev
	&& docker-php-ext-configure imap \
		--with-kerberos \
		--with-imap-ssl \
	&& docker-php-ext-install -j$(nproc) \
		imap \
	&& apt-get purge -y \
		libc-client-dev \
		libkrb5-dev

extension: imagick (pecl)

RUN apt-get update \
	&& apt-get install -y \
		libmagickwand-dev --no-install-recommends \
		ghostscript --no-install-recommends \
	&& pecl install \
		imagick \
	&& docker-php-ext-enable \
		imagick \
	&& apt-get purge -y \
		libmagickwand-dev

@asiby
Copy link

asiby commented Jan 20, 2020

Excellent. I prefer your steps better and the fact that they clean up after themselves.

@asiby
Copy link

asiby commented Mar 11, 2020

extension: mysqli

RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli

@ZnK88
Copy link

ZnK88 commented Dec 6, 2020

Thanks

@tmojzes
Copy link

tmojzes commented Apr 22, 2021

extension: zip

RUN apt-get update \
	&& apt-get install -y \
		libzip-dev \
	&& docker-php-ext-install -j$(nproc) \
		zip \
	&& apt-get purge -y \
		libzip-dev

@romfi
Copy link

romfi commented Jun 17, 2021

May you guide me on installing pdflib extension? Thank you!

@asiby
Copy link

asiby commented Jun 17, 2021

This is one possible way of installing pdflib. I have copied it from a dockerfile.

Disclaimer #1: I have not tried it.
Disclaimer #2: The URL for donwloading PDFlib is http (not secure) instead https.

ENV TNS_ADMIN=/etc

RUN curl -o /tmp/pdflib-php.tar.gz -SL "http://www.pdflib.com/binaries/PDFlib/906/PDFlib-9.0.6p2-Linux-x86_64-php.tar.gz" \
    && curl -o /tmp/oracle-instantclient.x86_64.rpm -SL "https://raw.githubusercontent.com/astrobl1904/docker-library/master/php-dev/commercial-components/oracle-instantclient.x86_64.rpm" \ 
   && yum --setopt=tsflags=nodocs --nogpgcheck -y install tar /tmp/oracle-instantclient.x86_64.rpm \ 
   && install -m 755 -d /usr/lib64/php/modules \ 
   && tar -xzf /tmp/pdflib-php.tar.gz -C /usr/lib64/php/modules --no-same-owner --no-same-permissions --strip-components=4 */php-700/php_pdflib.so \ 
   && echo "/usr/lib/oracle/12.1/client64/lib" > /etc/ld.so.conf.d/oracle-instantclient.x86_64.conf \ 
   && echo "# Placeholder tnsnames.ora for Docker containers" > $TNS_ADMIN/tnsnames.ora \ 
   && rm -rf /tmp/*.rpm /tmp/*.tar.gz

@vz-spr
Copy link

vz-spr commented Oct 16, 2021

Thank you!

@Romitou
Copy link

Romitou commented Nov 3, 2021

❤️

@eboboshka
Copy link

extension: wddx

This extension is DEPRECATED and UNBUNDLED as of PHP 7.4.0. - https://www.php.net/manual/en/intro.wddx.php

@EdwinWalela
Copy link

Trying to follow the format above to enable sockets with PHP 8.1.2 but no luck.

RUN docker-php-ext-install sockets && docker-php-ext-enable sockets

Any ideas?

@fredericogcruz
Copy link

error: /usr/src/php/ext/interbase does not exist

@chronon
Copy link
Author

chronon commented Feb 1, 2023

@EdwinWalela This works for me with PHP 8.2, no need for the enable part:

RUN docker-php-ext-install -j$(nproc) sockets

@hawkinstg
Copy link

Anyone have any guidance for installing the tidy extension? We've tried to no avail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment