Bref – Serverless PHP Functions on AWS

Bref comes as a Composer package and helps you deploy PHP applications to AWS and run them on AWS Lambda.

Bref uses the Serverless framework to configure and deploy serverless applications. Being the most popular tool, Serverless comes with a huge community, a lot of examples online and a simple configuration format.

After installing an initing Bref …

composer require bref/bref
vendor/bin/bref init

… all you need to do is wrap your code logic into the Bref-provided lambda fn:

require __DIR__.'/vendor/autoload.php';

lambda(function (array $event) {
    // Do anything you want here
    // For example:
    return 'Hello ' . ($event['name'] ?? 'world');

Bref – Serverless PHP made simple →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.