Demo serverless applications, examples code snippets and resources for PHP

Overview

The Serverless LAMP stack

The Serverless LAMP stack

Examples

Code example Description AWS blog link
0.1-SimplePhpFunction A very simple implementation of a PHP Lambda function. This uses a custom rumtime bootstrap and vendor dependencies as layers. Part1
0.2-Relational-Database-RDS-Proxy-Example A PHP Lambda function that connects to an Aurora MySQL database using Amazon RDS Proxy. Part2
0.3-Replacing-The-HTTP-Web-Server Routing all HTTP requests for static assets directly to S3 and all dynamic requests to a single Lambda function via API Gateway, using Bref's FPM custom runtime. Part3
0.4-Building-A-Serverless-Laravel-App Deploy a serverless Laravel application with AWS SAM. Part4
0.5-The CDK construct library for the serverless LAMP stack Deploy a serverless Laravel application with the AWS CDK. Part5
0.6-From-MVC-To-Microservices build serverless PHP applications using microservices. Part6
0.7-Building-PHP-Lambda-functions-with-Docker-container-images build a custom runtime PHP Lambda function packaged as a docker container image Part7

Community Curated PHP Serverless resources

serverless-php-resources.md - A community curated list of PHP / Serverless resources (videos, blogs, code examples frameworks, events).

Issue Reporting

If you have found a bug or if you have a feature request, please report them at this repository issues section.

License

This project is licensed under the MIT license. See the LICENSE file for more info.

Comments
  • 0.7 container image demo app doesn't work correctly once deployed

    0.7 container image demo app doesn't work correctly once deployed

    I followed all the steps to the letter and tested along the way.

    It passes the first local test:

    > curl "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{"queryStringParameters": {"name":"Ben"}}'
    {"statusCode":200,"headers":{"Content-Type":"application\/json","Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"Content-Type","Access-Control-Allow-Methods":"OPTIONS,POST"},"body":"Hello, Ben"}%
    

    Still works after sam build

    > echo '{"queryStringParameters": {"name":"Ben"}}' | sam local invoke --event  - "myPHPLambdaFuncton"
    Reading invoke payload from stdin (you can also pass it from file with --event)
    Invoking Container created from myphplambdafuncton:phpoci
    Building image.................
    Skip pulling image and use local one: myphplambdafuncton:rapid-1.37.0-x86_64.
    
    START RequestId: dc7a8354-9167-4f15-837b-467715a9efdc Version: $LATEST
    
    
     END RequestId: dc7a8354-9167-4f15-837b-467715a9efdc
    REPORT RequestId: dc7a8354-9167-4f15-837b-467715a9efdc  Init Duration: 0.93 ms  Duration: 48.44 ms      Billed Duration: 49 ms  Memory Size: 128 MB     Max Memory Used: 128 MB
    {"statusCode":200,"headers":{"Content-Type":"application\/json","Access-Control-Allow-Origin":"*","Access-Control-Allow-Headers":"Content-Type","Access-Control-Allow-Methods":"OPTIONS,POST"},"body":"Hello, Ben"}%                                                                                                                                                      
    

    But after I run sam deploy, the resulting Lambda does not return the correct output:

    > curl "https://jvtu5i3mgl.execute-api.us-east-1.amazonaws.com" -d '{"queryStringParameters": {"name":"Ben"}}'         
    Hello, %
    

    One odd thing that happened along the way: sam deploy -g did NOT prompt for image repository, as the README said. When I looked in samconfig.toml, I saw this value:

    image_repositories = ["myPHPLambdaFuncton=592584503830.dkr.ecr.us-east-1.amazonaws.com/myphplambdacontainerdemob95cc0b8/myphplambdafuncton976009f2repo"]
    

    And I noticed that a second ECR repository with this name was created. So I tried manually changing it to the repository URI from the previous step:

    image_repositories = ["myPHPLambdaFuncton=592584503830.dkr.ecr.us-east-1.amazonaws.com/php-lambda-functon"]
    

    and reran sam deploy. But I got the same result.

    opened by bawbgale 3
  • Error when running deploy

    Error when running deploy

    Hi, when im trying to deploy this using SAM im running into a problem.

    I have done following:

    • Cloned your repository
    • Installed AWS CLI and AWS SAM

    aws --version: aws-cli/2.0.52 Python/3.7.4 Darwin/19.6.0 exe/x86_64

    sam --version: SAM CLI, version 1.3.2

    When i run "sam deploy -g" i get this error: Traceback (most recent call last): File "/usr/local/bin/sam", line 33, in <module> sys.exit(load_entry_point('aws-sam-cli==1.3.2', 'console_scripts', 'sam')()) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/click/core.py", line 829, in __call__ return self.main(*args, **kwargs) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/click/core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/click/decorators.py", line 73, in new_func return ctx.invoke(f, obj, *args, **kwargs) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(*args, **kwargs) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/lib/telemetry/metrics.py", line 148, in wrapped raise exception # pylint: disable=raising-bad-type File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/lib/telemetry/metrics.py", line 114, in wrapped return_value = func(*args, **kwargs) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/commands/deploy/command.py", line 198, in cli config_env, File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/commands/deploy/command.py", line 248, in do_cli guided_context.run() File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/commands/deploy/guided_context.py", line 199, in run self.guided_prompts(_parameter_override_keys) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/commands/deploy/guided_context.py", line 115, in guided_prompts self.prompt_authorization(sanitize_parameter_overrides(input_parameter_overrides)) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/commands/deploy/guided_context.py", line 151, in prompt_authorization auth_required_per_resource = auth_per_resource(parameter_overrides, get_template_data(self.template_file)) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/commands/deploy/auth_utils.py", line 39, in auth_per_resource _auth_resource_event(sam_functions, sam_function, _auth_per_resource) File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/commands/deploy/auth_utils.py", line 68, in _auth_resource_event elif _auth_id(sam_functions.resources, event.get("Properties", {}), identifier): File "/usr/local/Cellar/aws-sam-cli/1.3.2/libexec/lib/python3.7/site-packages/samcli/commands/deploy/auth_utils.py", line 93, in _auth_id api_resource = resources_dict.get(resource_name, {}) TypeError: unhashable type: 'dict'

    opened by KevinSHansen 3
  • Removing .DS_Store

    Removing .DS_Store

    This PR is just to remove a bunch of .DS_Store files.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by abrahamcalf 2
  • Updating index function to run in deployed state

    Updating index function to run in deployed state

    Issue #, if available: #33

    Description of changes: Updated the index.php to decode base64 and decode the json element within, this allows the index file to run as intended once deployed to lambda as API GW will base64 encode the payload as "body" before sending to lambda. Also updated the readme file to include an updated curl command that injects the json payload as a base64 encoded body object.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by Kgirthofer 2
  • fixed typo in readme

    fixed typo in readme

    Issue #, if available:

    Description of changes:

    small typo in readme

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by cathalaherne2 2
  • entrypoint requires the handler name to be the first argument

    entrypoint requires the handler name to be the first argument

    Hi everyone,

    I'm trying to build the local environment for develop Lambda functions with PHP.

    I modify the Dockerfile (https://github.com/aws-samples/php-examples-for-aws-lambda/blob/master/0.7-PHP-Lambda-functions-with-Docker-container-images/Dockerfile)

    CMD ["index", "_HANDLER=/tasks/get_data"]

    Then got the error

    entrypoint requires the handler name to be the first argument

    What should the handler name be?

    Example I have the /tasks folder that contains the functions get_data, post_data. For serverless.yml, it will be config like this

    functions:
      task_get_data:
        timeout: 60
        handler: tasks/get_data.php
        layers:
          -  ${bref:layer.php-73}
      task_post_data:
        timeout: 60
        handler: tasks/post_data.php
        layers:
          -  ${bref:layer.php-73}
    

    How can I test these functions in local with docker container images?

    I'm looking forward to your help. Thank you so much.

    opened by tho-asterist 2
  • Articles: Run a serverless Laravel app with queue workers on AWS Lambda using Bref

    Articles: Run a serverless Laravel app with queue workers on AWS Lambda using Bref

    Issue #, if available: N/A

    Description of changes: New article about deploying and running a Laravel app with queue workers using Bref and Serverless.

    Any feedback on the article will be greatly appreciated whether or not the PR is accepted :)

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by thtg88 2
  • multiple serverless lamp fixes to work on current

    multiple serverless lamp fixes to work on current

    Issue #30 , if available:

    Description of changes:

    • fixed issue #30
    • added serverless HttpApi resource for referencing later in CF origin
    • ensure lambda layer is pulled from same aws region
    • updated breh and php to current versions
    • fixed lambda runtime issue with layer mismatch
    • this deploys cleanly following readme instructions

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by pieter-vandenburg 1
  • Fix-typo-in-readme

    Fix-typo-in-readme

    Issue #, if available:

    Description of changes:

    Fix small typo in readme

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by NicolasMugnier 1
  • sam deploy fails on 0.3-Replacing-The-HTTP-Web-Server-For-Traditional-PHP-Frameworks

    sam deploy fails on 0.3-Replacing-The-HTTP-Web-Server-For-Traditional-PHP-Frameworks

    Steps I took:

    git clone
    cd 0.3-Replacing-The-HTTP-Web-Server-For-Traditional-PHP-Frameworks
    composer require bref/bref
    sam deploy -g
    

    At this stage I tried a couple different options:

    Configuring SAM deploy
    ======================
    
    	Looking for config file [samconfig.toml] :  Not found
    
    	Setting default arguments for 'sam deploy'
    	=========================================
    	Stack Name [sam-app]: php-demo 
    	AWS Region [us-west-2]: 
    	#Shows you resources changes to be deployed and require a 'Y' to initiate deploy
    	Confirm changes before deploy [y/N]: 
    	#SAM needs permission to be able to create roles to connect to the resources in your template
    	Allow SAM CLI IAM role creation [Y/n]: 
    	CatchAllLambdaFunction may not have authorization defined, Is this okay? [y/N]: 
    Error: Security Constraints Not Satisfied!
    

    Since this immediately exited I tried answering yes:

    Configuring SAM deploy
    ======================
    
    	Looking for config file [samconfig.toml] :  Not found
    
    	Setting default arguments for 'sam deploy'
    	=========================================
    	Stack Name [sam-app]: php-demo 
    	AWS Region [us-west-2]: 
    	#Shows you resources changes to be deployed and require a 'Y' to initiate deploy
    	Confirm changes before deploy [y/N]: 
    	#SAM needs permission to be able to create roles to connect to the resources in your template
    	Allow SAM CLI IAM role creation [Y/n]: 
    	CatchAllLambdaFunction may not have authorization defined, Is this okay? [y/N]: y
    	CatchAllLambdaFunction may not have authorization defined, Is this okay? [y/N]: y
    	Save arguments to configuration file [Y/n]: 
    	SAM configuration file [samconfig.toml]: 
    	SAM configuration environment [default]: 
    
    	Looking for resources needed for deployment: Found!
    
    		Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-1xs0nt9a39zcd
    		A different default S3 bucket can be set in samconfig.toml
    
    	Saved arguments to config file
    	Running 'sam deploy' for future deployments will use the parameters saved above.
    	The above parameters can be changed by modifying samconfig.toml
    	Learn more about samconfig.toml syntax at 
    	https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-config.html
    
    Uploading to php-demo/e94ea55525  262144 / 1046025  (25.06Uploading to php-demo/e94ea55525  524288 / 1046025  (50.12Uploading to php-demo/e94ea55525  786432 / 1046025  (75.18Uploading to php-demo/e94ea55525  1046025 / 1046025  (100.00%)
    
    	Deploying with following values
    	===============================
    	Stack name                   : php-demo
    	Region                       : us-west-2
    	Confirm changeset            : False
    	Deployment s3 bucket         : aws-sam-cli-managed-default-samclisourcebucket-1xs0nt9a39zcd
    	Capabilities                 : ["CAPABILITY_IAM"]
    	Parameter overrides          : {}
    	Signing Profiles             : {}
    
    Initiating deployment
    =====================
    Uploading to php-demo/2c1a4de555204.template  3427 / 3427  (100.00%)
    
    Waiting for changeset to be created..
    
    CloudFormation stack changeset
    -------------------------------------------------------------------------------------------------
    Operation                LogicalResourceId        ResourceType             Replacement            
    -------------------------------------------------------------------------------------------------
    + Add                    AssetsBucketPolicy       AWS::S3::BucketPolicy    N/A                    
    + Add                    Assets                   AWS::S3::Bucket          N/A                    
    + Add                    CatchAllLambdaFunction   AWS::Lambda::Permissio   N/A                    
                             DynamicRequestsProxyPe   n                                               
                             rmission                                                                 
    + Add                    CatchAllLambdaFunction   AWS::Lambda::Permissio   N/A                    
                             DynamicRequestsRootPer   n                                               
                             mission                                                                  
    + Add                    CatchAllLambdaFunction   AWS::IAM::Role           N/A                    
                             Role                                                                     
    + Add                    CatchAllLambdaFunction   AWS::Lambda::Function    N/A                    
    + Add                    Cloudfrontdistribution   AWS::CloudFront::Distr   N/A                    
                                                      ibution                                         
    + Add                    S3OriginIdentityExampl   AWS::CloudFront::Cloud   N/A                    
                             e                        FrontOriginAccessIdent                          
                                                      ity                                             
    + Add                    ServerlessHttpApiApiGa   AWS::ApiGatewayV2::Sta   N/A                    
                             tewayDefaultStage        ge                                              
    + Add                    ServerlessHttpApi        AWS::ApiGatewayV2::Api   N/A                    
    -------------------------------------------------------------------------------------------------
    
    Changeset created successfully. arn:aws:cloudformation:us-west-2:xxx:changeSet/samcli-deploy555/5bb555fb58
    
    
    2021-12-21 09:46:44 - Waiting for stack create/update to complete
    
    CloudFormation events from changeset
    -------------------------------------------------------------------------------------------------
    ResourceStatus           ResourceType             LogicalResourceId        ResourceStatusReason   
    -------------------------------------------------------------------------------------------------
    CREATE_IN_PROGRESS       AWS::CloudFront::Cloud   S3OriginIdentityExampl   -                      
                             FrontOriginAccessIdent   e                                               
                             ity                                                                      
    CREATE_IN_PROGRESS       AWS::IAM::Role           CatchAllLambdaFunction   -                      
                                                      Role                                            
    CREATE_IN_PROGRESS       AWS::IAM::Role           CatchAllLambdaFunction   Resource creation      
                                                      Role                     Initiated              
    CREATE_IN_PROGRESS       AWS::S3::Bucket          Assets                   -                      
    CREATE_FAILED            AWS::IAM::Role           CatchAllLambdaFunction   Resource creation      
                                                      Role                     cancelled              
    CREATE_FAILED            AWS::S3::Bucket          Assets                   php-example-assets-    
                                                                               for-php-app-example-3  
                                                                               already exists         
    ROLLBACK_IN_PROGRESS     AWS::CloudFormation::S   php-demo                 The following          
                             tack                                              resource(s) failed to  
                                                                               create: [CatchAllLambd 
                                                                               aFunctionRole, Assets, 
                                                                               S3OriginIdentityExampl 
                                                                               e]. Rollback requested 
                                                                               by user.               
    CREATE_FAILED            AWS::CloudFront::Cloud   S3OriginIdentityExampl   Resource creation      
                             FrontOriginAccessIdent   e                        cancelled              
                             ity                                                                      
    DELETE_IN_PROGRESS       AWS::IAM::Role           CatchAllLambdaFunction   -                      
                                                      Role                                            
    DELETE_IN_PROGRESS       AWS::CloudFront::Cloud   S3OriginIdentityExampl   -                      
                             FrontOriginAccessIdent   e                                               
                             ity                                                                      
    DELETE_COMPLETE          AWS::S3::Bucket          Assets                   -                      
    DELETE_COMPLETE          AWS::IAM::Role           CatchAllLambdaFunction   -                      
                                                      Role                                            
    DELETE_COMPLETE          AWS::CloudFront::Cloud   S3OriginIdentityExampl   -                      
                             FrontOriginAccessIdent   e                                               
                             ity                                                                      
    ROLLBACK_COMPLETE        AWS::CloudFormation::S   php-demo                 -                      
                             tack                                                                     
    -------------------------------------------------------------------------------------------------
    Error: Failed to create/update the stack: php-demo, Waiter StackCreateComplete failed: Waiter encountered a terminal failure state: For expression "Stacks[].StackStatus" we matched expected path: "ROLLBACK_COMPLETE" at least once
    
    opened by dankbl 1
  • Fixing broken links to bootstrap file in example 1

    Fixing broken links to bootstrap file in example 1

    Issue #, if available: When following the steps in the example, I noticed that all the links to the bootstrap file were outdated and the wget returned a 404.

    Description of changes: I figured out the correct URL for the bootstrap file, completed the steps in the example to verify that it worked, and then updated the links in the readme file.

    By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

    opened by sbddesign 1
  • Bref SLIM bridge

    Bref SLIM bridge

    Is your feature request related to a problem? Please describe. A sample code for Slim micro-framework example.

    Describe the solution you'd like Something like bref/slim-bridge

    Describe alternatives you've considered There was an older bref SLIM bridge which is currently out of date and not working. https://medium.com/@jonbaldie/setting-up-a-serverless-php-website-with-aws-lambda-and-bref-e1f9fb48d3cd

    opened by maverick108 0
  • sam deploy -g fails

    sam deploy -g fails

    This makes reference to the 0.7-PHP-Lambda-functions-with-Docker-container-images folder.

    axel@ryzen:~/projects/foobar/poc-foobar-global-services$ sam --version
    SAM CLI, version 1.50.0
    axel@foobar:~/projects/foobar/poc-foobar-global-services$ sam deploy -g
    
    Configuring SAM deploy
    ======================
    
    	Looking for config file [samconfig.toml] :  Not found
    
    	Setting default arguments for 'sam deploy'
    	=========================================
    	Stack Name [sam-app]: my-php-lambda-container-demo
    	AWS Region [eu-west-1]: 
    	#Shows you resources changes to be deployed and require a 'Y' to initiate deploy
    	Confirm changes before deploy [y/N]: y
    	#SAM needs permission to be able to create roles to connect to the resources in your template
    	Allow SAM CLI IAM role creation [Y/n]: y
    	#Preserves the state of previously provisioned resources when an operation fails
    	Disable rollback [y/N]: n
    	myPHPLambdaFuncton may not have authorization defined, Is this okay? [y/N]: y
    	myPHPLambdaFuncton may not have authorization defined, Is this okay? [y/N]: y
    	Save arguments to configuration file [Y/n]: y
    	SAM configuration file [samconfig.toml]: 
    	SAM configuration environment [default]: 
    
    	Looking for resources needed for deployment:
    	 Managed S3 bucket: aws-sam-cli-managed-default-samclisourcebucket-9fyybvopfngg
    	 A different default S3 bucket can be set in samconfig.toml
    	 Image repositories: Not found.
    	 #Managed repositories will be deleted when their functions are removed from the template and deployed
    	 Create managed ECR repositories for all functions? [Y/n]: y
    Error: 
    S3 Bucket does not exist.
    

    Compared with what's on the documentation:

    opened by axl89 0
  • No such file or directory in /opt/bootstrap on line 29

    No such file or directory in /opt/bootstrap on line 29

    I'm getting this.

    {
      "errorMessage": "RequestId: 7161f214-824d-4b8f-82cd-01bad53a5e75 Error: Runtime exited with error: exit status 255",
      "errorType": "Runtime.ExitError"
    }
    
    
    Function Logs
    START RequestId: 7161f214-824d-4b8f-82cd-01bad53a5e75 Version: $LATEST
    Warning: require_once(/var/task/src/handler.php): failed to open stream: No such file or directory in /opt/bootstrap on line 29
    Fatal error: require_once(): Failed opening required '/var/task/src/handler.php' (include_path='.:/home/ec2-user/php-7-bin/lib/php') in /opt/bootstrap on line 29
    END RequestId: 7161f214-824d-4b8f-82cd-01bad53a5e75
    REPORT RequestId: 7161f214-824d-4b8f-82cd-01bad53a5e75	Duration: 26.02 ms	Billed Duration: 135 ms	Memory Size: 128 MB	Max Memory Used: 36 MB	Init Duration: 108.48 ms	
    RequestId: 7161f214-824d-4b8f-82cd-01bad53a5e75 Error: Runtime exited with error: exit status 255
    Runtime.ExitError
    
    opened by hassan-raza-com 1
  • No such file or directory in /opt/bootstrap on line 20

    No such file or directory in /opt/bootstrap on line 20

    Response { "errorMessage": "RequestId: ae39bce3-185d-4011-8edd-251bdb4a6f52 Error: Runtime exited with error: exit status 255", "errorType": "Runtime.ExitError" }

    Function Logs START RequestId: ae39bce3-185d-4011-8edd-251bdb4a6f52 Version: $LATEST Warning: require(/opt/vendor/autoload.php): failed to open stream: No such file or directory in /opt/bootstrap on line 20 Fatal error: require(): Failed opening required '/opt/vendor/autoload.php' (include_path='.:/home/ec2-user/environment/php-7-bin/lib/php') in /opt/bootstrap on line 20 END RequestId: ae39bce3-185d-4011-8edd-251bdb4a6f52 REPORT RequestId: ae39bce3-185d-4011-8edd-251bdb4a6f52 Duration: 125.65 ms Billed Duration: 126 ms Memory Size: 128 MB Max Memory Used: 9 MB RequestId: ae39bce3-185d-4011-8edd-251bdb4a6f52 Error: Runtime exited with error: exit status 255 Runtime.ExitError

    opened by tigerjun98 3
  • Container networking missing

    Container networking missing

    In tutorial 0.7-PHP-Lambda-functions-with-Docker-container-images the created container does not have access to the network. I did a simple try with gethostbyaddr:

    $reverse = gethostbyaddr('51.255.200.41');
    return APIResponse("Hello, ". $data['queryStringParameters']['name'] . " - $reverse");
    

    When testing into the local container gethostbyaddr return the IP address, becuause it can't query DNS servers. Pushing into AWS Lambda works fine.

    It would be fine to adjust this tutorial explainig how to do it.

    opened by g4b0 0
Owner
AWS Samples
AWS Samples
Private Composer registry for private PHP packages on AWS Serverless

Tug Tug is a Composer private registry for private PHP packages installable with Composer (1 and 2). The main idea of this project is to have an inter

Fxp 33 Oct 5, 2022
CDK patterns for serverless container with AWS Fargate

cdk-fargate-patterns CDK patterns for serverless container with AWS Fargate DualAlbFargateService Inspired by Vijay Menon from the AWS blog post intro

Pahud Hsieh 48 Sep 1, 2021
Apache OpenWhisk is an open source serverless cloud platform

OpenWhisk OpenWhisk is a serverless functions platform for building cloud applications. OpenWhisk offers a rich programming model for creating serverl

The Apache Software Foundation 5.9k Jan 8, 2023
Easily create and work with code snippets from PHP

code-snippets Easily create and work with code snippets from source code files of any type in PHP. The original code this package is based on was borr

Permafrost Software 8 Sep 4, 2022
A library of powerful code snippets to help you get the job done with Gravity Forms and Gravity Perks.

Gravity Wiz Snippet Library Gravity Wiz is creating the most comprehensive library of snippets for Gravity Forms ever. We'll be consistently moving ou

Gravity Wiz 151 Dec 27, 2022
A self-hosted alternative to putting your code snippets on Gist.

WP-Gistpen Contributors: JamesDiGioia Donate link: http://jamesdigioia.com/ Tags: gist, code snippets, codepen Requires at least: 5.2 Requires PHP: 5.

Intraxia 71 Nov 15, 2022
SERP Scraping API code examples for Python, PHP and Node.js

SERP Scraping API List of contents Introduction Authentication Google Baidu Bing Yandex Parameters Targets Languages License Introduction With our SER

Smartproxy 8 Nov 7, 2022
This Kirby V3 Plugin brings snippets and blueprints together in one place. It includes useful tools that completely changing the way you work with Kirby: Fast and well organized.

Kirby Components Overview Do you love to make awesome projects with Kirby CMS? Do you also find it difficult to switch between snippets and blueprints

Roman Gsponer 6 May 31, 2023
Collection of useful PHP functions, mini-classes, and snippets for every day.

JBZoo / Utils Collection of PHP functions, mini classes and snippets for everyday developer's routine life. Install composer require jbzoo/utils Usage

JBZoo Toolbox 786 Dec 30, 2022
Collection of PHP functions, mini classes and snippets for everyday developer's routine life

JBZoo / Utils Collection of PHP functions, mini classes and snippets for everyday developer's routine life. Install composer require jbzoo/utils Usage

JBZoo Toolbox 776 Jun 2, 2022
⚡ Php snippets, random stuff, demos, functions, fast message system, agnostic and framework free - 100% compactible ;) ⚡

⚡ Php8 FPM Nginx Fast, Scripts, Pearls & Treasures ?? Want to run and test asap ? docker-compose up -d phpgit_php8;ip=$(docker-machine ip default);ech

Benjamin FONTAINE 0 Mar 20, 2022
MagentoSnippets - Magento Front End Snippets, plugin for Sublime Text

MagentoSnippets Magento Front End Snippets, plugin for Sublime Text. This tool serves to aid the productivity during the Magento's theme development t

MageFront 27 Nov 1, 2022
Showing what's new in PHP 8 with examples and tests

#PHP 8 what's new with examples Showing what's new in PHP 8 with examples and tests. I believe that reading about the changes is not enough, so grab t

Grzegorz Bielski 1 Dec 14, 2022
Wordpress Plugin Boilerplate but Powered with examples and a generator!

WordPress Plugin Boilerplate Powered WordPress Plugin Boilerplate Powered is a complete foundation for building your WordPress plugins following PSR-4

WordPress Plugin Boilerplate Powered 604 Dec 24, 2022
Some Joomla! 4.x Web Services Api Examples and Experiments to raise the level of awareness of the huge potiental of Joomla! 4.x Web Services.

j4x-api-examples WHY? If you are a Joomla! developer or want to become a Joomla! developer there is a new resource for you The Official New Joomla! Ma

Mr Alexandre ELISÉ 11 Nov 29, 2022
Sitepackage for TYPO3 CMS that adheres to the recommended standards, maps all conceivable functional areas and contains examples for common use cases.

TYPO3 CMS Sitepackage This sitepackage sticks as closely as possible to the recommended standard and maps all conceivable functional areas. There are

Eric Bode 3 Dec 18, 2022
the examples of head first object oriented analysis & design - in PHP

Head First object oriented analysis & design in (PHP) after cloning the repository, you have to install the project's dependancies by running the foll

Muhammed ElFeqy 3 Oct 16, 2021
Design Pattern Examples in PHP

Design Patterns in PHP This repository is part of the Refactoring.Guru project. It contains PHP examples for all classic GoF design patterns. Each pat

Refactoring.Guru 909 Dec 22, 2022
Examples of some common design patterns implemented in php

What is a Design Pattern? Design patterns are typical solutions to common problems in software design. Each pattern is like a blueprint that you can c

Bakhtiyor Bahritidinov 4 Feb 11, 2022