Closed IvayLoRD closed 5 months ago
Hi @IvayLoRD!
Since this image is based on Docker Official PHP image, you can use the documentation from https://hub.docker.com/_/php section "How to install more PHP extensions".
Let us know if that works for you!
Hi, you can use either pecl or i recommend installing and using https://github.com/mlocati/docker-php-extension-installer
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions bcmath \
iconv ## and more ..
Hi @IvayLoRD,
I had to install some of these packages on top of a unit image yesterday. Here's my docker file that I used as a base for working with WordPress:
FROM unit:1.31.1-php8.2
# Install absolutely required packages without which WordPress does not start
RUN apt update && apt install -y libicu-dev git
RUN docker-php-ext-install intl pdo_mysql mysqli
# Install exif, opcache, shmop, sockets, and zip packages
RUN apt install -y libzip-dev ghostscript
RUN docker-php-ext-install exif opcache shmop sockets zip
# Install ssh2 php module
RUN apt install -y libssh2-1-dev libssh2-1
RUN pecl install ssh2
RUN docker-php-ext-enable ssh2
# Install imagick extension
RUN apt install -y libmagickwand-dev
RUN pecl install imagick
RUN docker-php-ext-enable imagick
# Install igbinary
RUN pecl install igbinary
RUN docker-php-ext-enable igbinary
# Install redis
RUN pecl install redis
RUN docker-php-ext-enable redis
# Install image (the php extension "image" per the handbook)
RUN docker-php-ext-install gd
# Install bc (bcmath)
RUN docker-php-ext-install bcmath
WORKDIR /wpms/
RUN chown -R unit:unit /wpms/
Your actual needs will be different, but in general the two potential ways of installing packages are
docker-php-ext-install
. This list gives me all packages that are installable: bcmath bz2 calendar ctype curl dba dl_test dom enchant exif ffi fileinfo filter ftp gd gettext gmp hash iconv imap intl json ldap mbstring mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell random readline reflection session shmop simplexml snmp soap sockets sodium spl standard sysvmsg sysvsem sysvshm tidy tokenizer xml xmlreader xmlwriter xsl zend_test zip
docker-php-ext-enable
For more info see https://hub.docker.com/_/php, the "How to install more PHP extensions heading"
Alternatively the way @JanMikes showed would also work.
Hello, sorry for the question, it may seem stupid to you, can someone explain how it could be added BC Math Fileinfo, GMP, Iconv, Intl, MBString, OpenSSL***, SOAP and ionCube Loader for PHP version in image public.ecr.aws/nginx/unit:1.31.1-php8.2 because I didn't see anything like that anywhere .