Skip to content

Commit

Permalink
Extensions and Clients (#145)
Browse files Browse the repository at this point in the history
* add imagick and xdebug to 8.4 image

* use xdebug beta for now

* xdebug support for 8.4 is stable

* add xhprof

* Use install-php-extensions in 7.4+ images

* Add mariadb client

Resolves #120

* update sqlite version to 3.45.1

Resolves lando/drupal#119
  • Loading branch information
AaronFeledy authored Dec 9, 2024
1 parent ad8aad3 commit 752987b
Show file tree
Hide file tree
Showing 14 changed files with 308 additions and 251 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})

* Updated 8.4RC image to 8.4 stable.
* Added MariaDB client tools to PHP 7.4-8.4 images [#120](https://github.com/lando/php/issues/120).
* Added `xdebug` and `imagick` extension to PHP 8.4 images.
* Added `xhprof` extension to PHP 7.4-8.4 images.
* Added `imagick` extension to PHP 8.3 images.
* Updated `sqlite3` to 3.45.1 in PHP 8.3-8.4 images.

## v1.6.3 - [December 7, 2024](https://github.com/lando/php/releases/tag/v1.6.3)

* Optimized for `midcore`
Expand Down
17 changes: 7 additions & 10 deletions docs/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: Learn what extensions are installed in the Lando PHP plugin
| | 5.3 | 5.4 | 5.5 | 5.6 | 7.0 | 7.1 | 7.2 | 7.3 | 7.4 | 8.0 | 8.1 | 8.2 | 8.3 | 8.4 |
| -- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| apc | X | X | | | | | | | | | | | | |
| apcu | | | X | X | X | X | X | X | X | | | | | X |
| apcu | | | X | X | X | X | X | X | X | X | X | X | X | X |
| bcmath | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| bz2 | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| calendar | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
Expand All @@ -25,18 +25,18 @@ description: Learn what extensions are installed in the Lando PHP plugin
| gettext | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| hash | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| iconv | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| imagick | X | X | X | X | X | X | X | X | X | X | X | X | * | |
| imagick | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| imap | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| intl | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| json | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| ldap | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| libxml | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| mbstring | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| mcrypt | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| memcached | X | X | X | X | X | X | X | X | X | | | | | X |
| memcached | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| mysqli | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| mysqlnd | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| OAuth | X | X | X | X | X | X | X | X | X | | | | | X |
| OAuth | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| OPcache | | | X | X | X | X | X | X | X | X | X | X | X | X |
| openssl | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| pcntl | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
Expand All @@ -58,18 +58,15 @@ description: Learn what extensions are installed in the Lando PHP plugin
| sqlite3 | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| standard | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| tokenizer | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| xdebug | | | | | | | | | | | | | | |
| xdebug | * | * | * | * | * | * | * | * | * | * | * | * | * | * |
| xhprof | | | | | | | | | X | X | X | X | X | X |
| xml | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| xmlreader | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| xmlwriter | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| zip | X | X | X | X | X | X | X | X | X | X | X | X | X | X |
| zlib | X | X | X | X | X | X | X | X | X | X | X | X | X | X |

Note that `xdebug` is off by default but you can enable it by setting your `php` services config to `xdebug: true`. Read more about this in "Configuration" above.

::: warning
Note that imagick is temporarily unavailable on PHP 8.3/8.4, due to a pending issue waiting to get released on the imagick project: https://github.com/Imagick/imagick/pull/641
:::
__*__ Note that `xdebug` is off by default but you can enable it by setting your `php` services config to `xdebug: true`. Read more about this in "Configuration" above.

## Adding or removing extensions

Expand Down
100 changes: 44 additions & 56 deletions images/7.4-apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,22 @@

FROM php:7.4-apache-bullseye

# Install dependencies we need
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN \
# MariaDB client compatibility (https://github.com/lando/php/issues/120)
mkdir -p /etc/apt/keyrings \
&& curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp' \
&& echo "deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mirror.mariadb.org/repo/10.5/debian bullseye main" > /etc/apt/sources.list.d/mariadb.list

RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
&& apt -y update && apt-get install -y \
bzip2 \
default-mysql-client \
exiftool \
git-core \
gnupg2 \
imagemagick \
libbz2-dev \
libc-client-dev \
libicu-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libldap2-dev \
libmagickwand-dev \
libmemcached-dev \
libpng-dev \
libpq-dev \
libssl-dev \
libwebp-dev \
libxml2-dev \
libzip-dev \
libonig-dev \
mariadb-client \
openssl \
postgresql-client-13 \
pv \
Expand All @@ -34,45 +26,41 @@ RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
unzip \
wget \
xfonts-75dpi \
xfonts-base \
zlib1g-dev \
&& pecl install apcu \
&& pecl install imagick \
&& pecl install memcached \
&& pecl install oauth-2.0.4 \
&& pecl install redis-5.1.1 \
&& pecl install xdebug-3.1.6 \
&& docker-php-ext-configure ldap --with-libdir=lib/$(uname -m)-linux-gnu/ \
&& docker-php-ext-enable apcu \
&& docker-php-ext-enable imagick \
&& docker-php-ext-enable memcached \
&& docker-php-ext-enable oauth \
&& docker-php-ext-enable redis \
&& docker-php-ext-install bcmath \
&& docker-php-ext-install bz2 \
&& docker-php-ext-install calendar \
&& docker-php-ext-install exif \
&& docker-php-ext-install gettext \
&& docker-php-ext-install intl \
&& docker-php-ext-install ldap \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install opcache \
&& docker-php-ext-install pcntl \
&& docker-php-ext-install pdo \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install pdo_pgsql \
&& docker-php-ext-install soap \
&& docker-php-ext-install zip \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.2.12 \
&& php -r "unlink('composer-setup.php');" \
&& chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
xfonts-base

RUN \
install-php-extensions @fix_letsencrypt \
&& install-php-extensions apcu \
&& install-php-extensions bcmath \
&& install-php-extensions bz2 \
&& install-php-extensions calendar \
&& install-php-extensions exif \
&& install-php-extensions gd \
&& install-php-extensions gettext \
&& install-php-extensions imagick \
&& install-php-extensions imap \
&& install-php-extensions intl \
&& install-php-extensions ldap \
&& install-php-extensions mbstring \
&& install-php-extensions memcached \
&& install-php-extensions mysqli \
&& install-php-extensions oauth \
&& install-php-extensions opcache \
&& install-php-extensions pcntl \
&& install-php-extensions pdo \
&& install-php-extensions pdo_mysql \
&& install-php-extensions pdo_pgsql \
&& install-php-extensions redis \
&& install-php-extensions soap \
&& install-php-extensions xdebug \
&& install-php-extensions xhprof \
&& install-php-extensions zip

RUN install-php-extensions @composer-2.2.12

RUN \
chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
&& apt-get -y clean \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* && rm -rf && rm -rf /var/lib/cache/* && rm -rf /var/lib/log/* && rm -rf /tmp/* \
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install imap \
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install gd
&& rm -rf /var/lib/apt/lists/* && rm -rf && rm -rf /var/lib/cache/* && rm -rf /var/lib/log/* && rm -rf /tmp/*
126 changes: 57 additions & 69 deletions images/7.4-fpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,77 +2,65 @@

FROM php:7.4-fpm-bullseye

# Install dependencies we need
ADD --chmod=0755 https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/

RUN \
# MariaDB client compatibility (https://github.com/lando/php/issues/120)
mkdir -p /etc/apt/keyrings \
&& curl -o /etc/apt/keyrings/mariadb-keyring.pgp 'https://mariadb.org/mariadb_release_signing_key.pgp' \
&& echo "deb [signed-by=/etc/apt/keyrings/mariadb-keyring.pgp] https://mirror.mariadb.org/repo/10.5/debian bullseye main" > /etc/apt/sources.list.d/mariadb.list

RUN mkdir -p /usr/share/man/man1 /usr/share/man/man7 \
&& apt -y update && apt-get install -y \
bzip2 \
default-mysql-client \
exiftool \
git-core \
gnupg2 \
imagemagick \
libbz2-dev \
libc-client-dev \
libicu-dev \
libjpeg62-turbo-dev \
libkrb5-dev \
libldap2-dev \
libmagickwand-dev \
libmemcached-dev \
libpng-dev \
libpq-dev \
libssl-dev \
libwebp-dev \
libxml2-dev \
libzip-dev \
libonig-dev \
openssl \
postgresql-client-13 \
pv \
rsync \
ssh \
unzip \
wget \
xfonts-75dpi \
xfonts-base \
zlib1g-dev \
&& pecl install apcu \
&& pecl install imagick \
&& pecl install memcached \
&& pecl install oauth-2.0.4 \
&& pecl install redis-5.1.1 \
&& pecl install xdebug-3.1.6 \
&& docker-php-ext-configure ldap --with-libdir=lib/$(uname -m)-linux-gnu/ \
&& docker-php-ext-enable apcu \
&& docker-php-ext-enable imagick \
&& docker-php-ext-enable memcached \
&& docker-php-ext-enable oauth \
&& docker-php-ext-enable redis \
&& docker-php-ext-install bcmath \
&& docker-php-ext-install bz2 \
&& docker-php-ext-install calendar \
&& docker-php-ext-install exif \
&& docker-php-ext-install gettext \
&& docker-php-ext-install intl \
&& docker-php-ext-install ldap \
&& docker-php-ext-install mbstring \
&& docker-php-ext-install mysqli \
&& docker-php-ext-install opcache \
&& docker-php-ext-install pcntl \
&& docker-php-ext-install pdo \
&& docker-php-ext-install pdo_mysql \
&& docker-php-ext-install pdo_pgsql \
&& docker-php-ext-install soap \
&& docker-php-ext-install zip \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=2.2.12 \
&& php -r "unlink('composer-setup.php');" \
&& chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
default-mysql-client \
exiftool \
git-core \
gnupg2 \
libonig-dev \
mariadb-client \
openssl \
postgresql-client-13 \
pv \
rsync \
ssh \
unzip \
wget \
xfonts-75dpi \
xfonts-base

RUN \
install-php-extensions @fix_letsencrypt \
&& install-php-extensions apcu \
&& install-php-extensions bcmath \
&& install-php-extensions bz2 \
&& install-php-extensions calendar \
&& install-php-extensions exif \
&& install-php-extensions gd \
&& install-php-extensions gettext \
&& install-php-extensions imagick \
&& install-php-extensions imap \
&& install-php-extensions intl \
&& install-php-extensions ldap \
&& install-php-extensions mbstring \
&& install-php-extensions memcached \
&& install-php-extensions mysqli \
&& install-php-extensions oauth \
&& install-php-extensions opcache \
&& install-php-extensions pcntl \
&& install-php-extensions pdo \
&& install-php-extensions pdo_mysql \
&& install-php-extensions pdo_pgsql \
&& install-php-extensions redis \
&& install-php-extensions soap \
&& install-php-extensions xdebug \
&& install-php-extensions xhprof \
&& install-php-extensions zip

RUN install-php-extensions @composer-2.2.12

RUN \
chsh -s /bin/bash www-data && mkdir -p /var/www/.composer && chown -R www-data:www-data /var/www \
&& apt-get -y clean \
&& apt-get -y autoclean \
&& apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/* && rm -rf && rm -rf /var/lib/cache/* && rm -rf /var/lib/log/* && rm -rf /tmp/* \
&& PHP_OPENSSL=yes docker-php-ext-configure imap --with-kerberos --with-imap-ssl \
&& docker-php-ext-install imap \
&& docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install gd
&& rm -rf /var/lib/apt/lists/* && rm -rf && rm -rf /var/lib/cache/* && rm -rf /var/lib/log/* && rm -rf /tmp/*
Loading

0 comments on commit 752987b

Please sign in to comment.