Skip to content

umutc/aws-lambda-layer-php73

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AWS Lambda PHP Hello World

The basics of using SAM Cli for AWS Lambda PHP applications.

Deploy

  1. Install SAM Cli by following the Quick Start
  2. Set up your AWS credentials
  3. Create php binary by following steps in doc/create_php_binary.md or use Php 7.3.1 or just put the yml this projects ARN 'arn:aws:lambda:eu-central-1:303814004728:layer:aws-lambda-layer-php-7-3-1:3'
  4. Write your serverless application (!) - the default is in src/handlers/hello.php
  5. Run ./deploy.sh to deploy to Lambda

PHP handler function signature

Handler: filename.functionName hello.hello 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];
}

About

AWS lambda layer for php 7.3.1 and SAM Deployment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published