Start Building for Free
CircleCI.comAcademyBlogCommunitySupport
  • cimg/php
  • Getting Started
  • How This Image Works
  • Image Tags
  • Variants
    • Node.js
    • Browsers
  1. Convenience Images
  2. cimg/php

cimg/php

Sections

This image is designed to supercede the legacy CircleCI PHP image, circleci/php.

cimg/php is a Docker image created by CircleCI with continuous integration builds in mind. Each tag contains a complete PHP version and Composer, everything required for builds to complete successfully in a CircleCI environment.

Getting Started

This image can be used with the CircleCI docker executor. For example:

1 2 3 4 5 6 7 jobs: build: docker: - image: cimg/php:8.4.1 steps: - checkout - run: php --version

In the above example, the CircleCI PHP Docker image is used for the primary container. More specifically, the tag 8.4.1 is used meaning the version of PHP will be PHP v8.4.1. You can now use PHP within the steps for this job.

How This Image Works

This image contains the PHP programming language as well as Composer and a few very popular PHP extensions.

Tagging Scheme

This image has the following tagging scheme:

cimg/php:<php-version>[-variant]

<php-version> - The version of PHP to use. This can be a full SemVer point release (such as 7.3.11) or just the minor release (such as 7.3). If you use the minor release tag, it will automatically point to future patch updates as they are released by the PHP Team. For example, the tag 7.3 points to PHP v7.3.11 now, but when the next release comes out, it will point to PHP v7.3.12.

[-variant] - Variant tags, if available, can optionally be used. For example, the Node.js variant could be used like this: cimg/php:7.3-node.

Image Tags

Variants

Variant images typically contain the same base software, but with a few additional modifications.

Node.js

The Node.js variant is the same PHP image but with Node.js also installed. The Node.js variant can be used by appending -node to the end of an existing cimg/php tag.

1 2 3 4 5 6 7 8 jobs: build: docker: - image: cimg/php:8.4.1-node steps: - checkout - run: php --version - run: node --version

Browsers

The browsers variant is the same PHP image but with Node.js, Java, Selenium, and browser dependencies pre-installed via apt. The browsers variant can be used by appending -browser to the end of an existing cimg/php tag. The browsers variant is designed to work in conjunction with the CircleCI Browser Tools orb. You can use the orb to install a version of Google Chrome and/or Firefox into your build. The image contains all of the supporting tools needed to use both the browser and its driver.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 orbs: browser-tools: circleci/browser-tools@1.1 jobs: build: docker: - image: cimg/php:7.4.14-browsers steps: - browser-tools/install-browser-tools - checkout - run: | php --version node --version java --version google-chrome --version
Developer Updates
Get tips to optimize your builds
Or join our research panel and give feedback
By submitting this form, you are agreeing to ourTerms of UseandPrivacy Policy.