The basics of using Serverless Framework for AWS Lambda PHP applications.
Clone or download
Latest commit 8a19df0 Jan 8, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc Improvements to create_php_binary.md Jan 7, 2019
layer/php Remove unnecessary output buffering Jan 3, 2019
.gitignore Initial commit Jan 1, 2019
LICENSE Add license Dec 31, 2018
README.md Update docs Jan 1, 2019
handler.php Setting up for taking POST values Jan 7, 2019
serverless.yml Revert to eu-west-2 Jan 8, 2019

README.md

AWS Lambda PHP Hello World

The basics of using Serverless Framework for AWS Lambda PHP applications.

Notes

  1. Install Serverless Framework by following the Quick Start
  2. Set up your AWS credentials
  3. Create php binary by following steps in doc/create_php_binary.md
  4. Write your serverless application (!) - the default is in handler.php
  5. Run sls deploy to deploy to Lambda
  6. Run sls invoke -f hello -l to invoke your function

PHP handler function signature

The signature for the PHP function is:

function main($eventData) : array

Hello world looks like:

<?php
function hello($eventData) : array
{
    return ["msg" => "Hello from PHP " . PHP_VERSION];
}