Skip to content

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

License

Notifications You must be signed in to change notification settings

matipl-pl/lambda-php-sls-hello-world

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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];
}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 96.3%
  • Shell 3.7%