There is no built-in support for PHP on AWS Lambda. Instead we need to use 3rd party runtimes via the system of Lambda layers.

Bref provides the runtimes (aka layers) needed to run PHP applications, whether they run via HTTP or CLI.

This page is an introduction to the runtimes. The next sections (e.g. PHP functions, HTTP applications) will show how to use them in your project.

Bref runtimes

The name of the runtimes follow this pattern:


Region (<region>)

The <region> placeholder should contain your application's region. You need to use the same region as the rest of your application else Lambda will not find the layer.

Runtime (<layer-name>)

Bref currently provides runtimes for PHP 7.2 and 7.3.

php-73 means PHP 7.3.*. It is not possible to require a specific "patch" version.

Layer version (<layer-version>)

The list of runtime versions is hosted at and is shown below:


To use a runtime you need to import the corresponding layer into your Lambda. For example using AWS SAM:

AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
        Type: AWS::Serverless::Function
        Runtime: provided
                - '<the layer ARN here>'

You can read more about this in the next sections.