docker-images-php
docker-images-php copied to clipboard
How to install and enable all possible PHP extensions
Hi, Thank you for your awesome Dockerfiles.
How can I install and enable all PHP extensions which are available in extensions
directory for every php version with thecodingmachine/php:${PHP_VERSION}-v4-slim-apache
image.
Does this Dockerfile do the job?
FROM thecodingmachine/php:${PHP_VERSION}-v4-slim-apache
USER root
RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all.sh
Or do it like this?
FROM thecodingmachine/php:7.2-v4-slim-apache
USER root
RUN cd /usr/local/lib/thecodingmachine-php/extensions/current/ && ./install_all.sh && ./disable_all.sh
ENV PHP_EXTENSIONS="amqp apcu ast bcmath blackfire bz2 dba ds enchant ev event gd gmp gnupg grpc igbinary imagick imap intl ldap mailparse mcrypt memcached mongodb msgpack mysqli pcov pdo_mysql pdo_pgsql pdo_sqlite pgsql pspell rdkafka redis snmp soap sqlite3 swoole tidy uploadprogress uuid weakref xdebug xmlrpc yaml"
You should do like that :
ARG PHP_EXTENSIONS="amqp apcu ast bcmath blackfire bz2 dba ds enchant ev event gd gmp gnupg grpc igbinary imagick imap intl ldap mailparse mcrypt memcached mongodb msgpack mysqli pcov pdo_mysql pdo_pgsql pdo_sqlite pgsql pspell rdkafka redis snmp soap sqlite3 swoole tidy uploadprogress uuid weakref xdebug xmlrpc yaml"
FROM thecodingmachine/php:7.2-v4-slim-apache
ENV PHP_EXTENSIONS="${PHP_EXTENSIONS}"
/!\ ARG should be before the first "FROM" instruction of the Dockerfile file.