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

igorjs/serverless-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 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 globally by following the Quick Start
  2. Install Composer following these instructions
  3. Install Composer dependencies via ./bin/composer.phar install
  4. Set up your AWS credentials
  5. Write your serverless application (!) - the default is in src/hello.handler.php
  6. Run sls deploy to deploy to Lambda
  7. Run sls invoke -f hello -l to invoke your function

PHP handler function signature

The signature for the PHP function is:

function main($event) : array

Hello world looks like:

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

About

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

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages