Unit: Docker image for PHP 7.4.

Created on 28 Feb 2020  路  4Comments  路  Source: nginx/unit

Hello colleagues. Tell me please, when the image for php 7.4 will be ready?

Most helpful comment

I've just made it using Custom Module approach: https://hub.docker.com/r/piotrpazola/nginx-unit

I've just done it because I need the newest PDO MYSQL support for MYSQL 8.0 authentication without any issues. The "SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client 'name'" is really common problem with newest MYSQL instances.

As I described on Docker Hub:

_NGINX Unit tagged as 1.20.0-php7.4-pdo-mysql with PHP7.4 and PDO MYSQL support based on nginx/unit:1.20.0-minimal.

NGINX Unit is available only with PHP 7.3 and older implementation of PDO MYSQL does not support newest authentication of MYSQL 8.0 from the image of nginx/unit:1.20.0-php7.3. (Oct 2020)

I've build the newest compilation of PHP 7.4 with embeded support of PHP for the NGINX Unit and newest PDO MYSQL module working well with MYSQL 8.0 without any authentication issues.

It's based on nginx/unit:1.20.0-minimal where module for Unit is built from sources of php7.4 and unit1.20.0 then the prepared package is copied to next stage of builiding in Dockerfile starting building on clean nginx/unit:1.20.0-minimal image. How to prepare custom modules for NGINX Unit is describe here: https://unit.nginx.org/howto/modules/ and my approach has been using it in the first stage.

I've tried to make the image the smallest as possible. It's just approx. 10 MB bigger than offcial NGINX Unit nginx/unit:1.20.0-php7.3 with PHP 7.3 and old PDO MYSQL support installed by apk from Debian 10 repository._

All 4 comments

Good afternoon, dear colleagues. It has been 3 months since I asked a question about support PHP 7.4. Tell me please, is it worth it to wait at all?

All our Docker images are based on Debian 10 (buster), which provides only PHP 7.3.
PHP 7.4 will be available as soon as Debian 10 will provide it.

I've just made it using Custom Module approach: https://hub.docker.com/r/piotrpazola/nginx-unit

I've just done it because I need the newest PDO MYSQL support for MYSQL 8.0 authentication without any issues. The "SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client 'name'" is really common problem with newest MYSQL instances.

As I described on Docker Hub:

_NGINX Unit tagged as 1.20.0-php7.4-pdo-mysql with PHP7.4 and PDO MYSQL support based on nginx/unit:1.20.0-minimal.

NGINX Unit is available only with PHP 7.3 and older implementation of PDO MYSQL does not support newest authentication of MYSQL 8.0 from the image of nginx/unit:1.20.0-php7.3. (Oct 2020)

I've build the newest compilation of PHP 7.4 with embeded support of PHP for the NGINX Unit and newest PDO MYSQL module working well with MYSQL 8.0 without any authentication issues.

It's based on nginx/unit:1.20.0-minimal where module for Unit is built from sources of php7.4 and unit1.20.0 then the prepared package is copied to next stage of builiding in Dockerfile starting building on clean nginx/unit:1.20.0-minimal image. How to prepare custom modules for NGINX Unit is describe here: https://unit.nginx.org/howto/modules/ and my approach has been using it in the first stage.

I've tried to make the image the smallest as possible. It's just approx. 10 MB bigger than offcial NGINX Unit nginx/unit:1.20.0-php7.3 with PHP 7.3 and old PDO MYSQL support installed by apk from Debian 10 repository._

Hi @ElDarco @piotrpazola.

We've decided to indeed not to chase Bullseye release but provide a way to use newer language runtimes without being tied to Debian releases. Now, we don't build and publish PHP 7.4 images, but 8.0 instead; you can, however easily build those with the following commands:

$ git clone https://github.com/nginx/unit
$ cd unit
$ git checkout 1.22.0
$ cd pkg/docker/
$ make build-php7.4 VERSION_php=7.4

As a result you will have a local docker image under the name of unit:1.22.0-php7.4 which you can use for your deployments and/or push to your local registries.

As the images are based on official Docker images for the runtimes, you can use the same tricks installing the extensions.

Was this page helpful?
0 / 5 - 0 ratings