PHP 7.0 via Docker

PHP 7.0 via Docker

Download / Install

This version is no longer officially supported.

Official support refers to that provided direct by the PHP Project.

If you install PHP via third-party packages, support timelines may be different. Please read the Release Support Policy for more information.

The latest release tag gets updated every time a new release comes out on this version, or you can pin to a specific version.


"Docker" is the industry standard name for Linux container managers. However, there are many different tools that also operate on containers such as Podman, as well as serverless functionality such as Cloud Run, and large-scale container orchestrators such as Kubernetes.

Note: These example commands assumes your code will be mounted into /app and will run via the inbuilt dev server on port 8080.

Dockerfile

FROM php:-cli WORKDIR /app

Development Server

Run PHP using the inbuilt development server.

This single-threaded HTTP server mode is only suitable for development and it is highly recommended to deploy via FrankenPHP or FPM for production environments.

docker run --rm -it -p 8080:8080 -v "$(pwd)":/app -w /app php:-cli php -S 0.0.0.0:8080