This example shows how to run a PHP application on AWS Lambda.
We add PHP layer to the function and configure wrapper script.
- attach PHP layer to your function. This layer contains the PHP binary and a wrapper script.
- x86_64:
arn:aws:lambda:${AWS::Region}:753240598075:layer:Php82FpmNginxX86:13 - arm64:
arn:aws:lambda:${AWS::Region}:753240598075:layer:Php82FpmNginxArm:13
- x86_64:
Run the following commands to build and deploy the application to lambda.
sam build
sam deploy --guidedWhen the deployment completes, take note of URL's Value. It is the API Gateway endpoint URL.
Open URL's URL in a browser, you should see phpinfo() on the page.