{"id":20594905,"url":"https://github.com/thbley/php-lambda","last_synced_at":"2025-04-13T22:44:23.583Z","repository":{"id":162095484,"uuid":"169271593","full_name":"thbley/php-lambda","owner":"thbley","description":"Getting started with PHP on AWS Lambda","archived":false,"fork":false,"pushed_at":"2021-07-30T21:50:07.000Z","size":2886,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-16T08:44:43.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.youtube.com/watch?v=5cLZ5jT2Gi0","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thbley.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-05T16:20:11.000Z","updated_at":"2023-02-21T07:14:25.000Z","dependencies_parsed_at":"2023-06-18T01:16:09.224Z","dependency_job_id":null,"html_url":"https://github.com/thbley/php-lambda","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbley%2Fphp-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbley%2Fphp-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbley%2Fphp-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thbley%2Fphp-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thbley","download_url":"https://codeload.github.com/thbley/php-lambda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248794566,"owners_count":21162613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T08:10:46.543Z","updated_at":"2025-04-13T22:44:22.597Z","avatar_url":"https://github.com/thbley.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Getting started with PHP on AWS Lambda\n\n```\ndocker build -t lambda-php-runtime .\n\ndocker run --rm --entrypoint /opt/bin/php lambda-php-runtime -v\ndocker run --rm --entrypoint /opt/bin/php lambda-php-runtime -m\ndocker run --rm --entrypoint /opt/bin/php lambda-php-runtime -r 'echo 0.7+0.1;'\ndocker run --rm --entrypoint /opt/bin/php lambda-php-runtime -r 'echo json_encode(0.7+0.1);'\n\ndocker run --rm --entrypoint bash lambda-php-runtime -c \"cat /opt/bin/php\" \u003ebin/php\n\ndocker run --rm -v \"$PWD\":/var/task lambda-php-runtime hello '{\"Hello\": \"bephpug\"}'\n\nzip -r runtime.zip bootstrap bin\nzip -r vendor.zip vendor/\n\naws iam create-role \\\n    --role-name LambdaPhp --path \"/service-role/\" \\\n    --assume-role-policy-document file://trust-policy.json\n\naws lambda publish-layer-version \\\n    --layer-name php-runtime --region eu-central-1 \\\n    --zip-file fileb://runtime.zip\n\naws lambda publish-layer-version \\\n    --layer-name php-vendor --region eu-central-1 \\\n    --zip-file fileb://vendor.zip\n\nzip hello.zip src/hello.php\n\naws lambda create-function --function-name php-hello --handler hello \\\n    --runtime provided --region eu-central-1 \\\n    --zip-file fileb://hello.zip \\\n    --role \"arn:aws:iam::\u003cgiven output from trust-policy upload\u003e\" \\\n    --layers \"arn:aws:lambda:\u003cgiven output from runtime zip upload\u003e\" \\\n                 \"arn:aws:lambda:\u003cgiven output from vendor zip upload\" \\\n                 \"arn:aws:lambda:::awslayer:AmazonLinux1803\" \\\n    --memory-size 128 --timeout 5\n\naws lambda update-function-code --function-name php-hello \\\n    --zip-file fileb://hello.zip \\\n    --region eu-central-1\n\naws lambda invoke --function-name php-hello \\\n    --region eu-central-1 --log-type Tail --query 'LogResult' \\\n     --output text --payload '{\"Hello\": \"bephpug\"}' \\\n    output.txt | base64 --decode\n```\n\nsources:\n- https://github.com/akrabat/lambda-php\n- https://hub.docker.com/r/lambci/lambda/\n- https://aws.amazon.com/de/blogs/apn/aws-lambda-custom-runtime-for-php-a-practical-example/\n- https://en.wikipedia.org/wiki/AWS_Lambda\n- https://docs.aws.amazon.com/en_en/lambda/latest/dg/limits.html\n- https://www.ec2instances.info\n- https://aws.amazon.com/lambda/pricing/\n- https://www.trek10.com/blog/lambda-cost/\n- https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraMySQL.Integrating.Lambda.html\n- https://wiki.php.net/rfc/jit\n- https://github.com/mk-j/PHP_diseval_extension\n- https://tideways.com/profiler/blog/dodge-the-thundering-herd-with-file-based-opcache-in-php7\n- https://firecracker-microvm.github.io/\n- https://fosdem.org/2019/schedule/event/containers_firecracker/attachments/slides/3188/export/events/attachments/containers_firecracker/slides/3188/Firecracker_as_a_container_runtime_FOSDEM2019_4_3.pdf\n- https://aws.amazon.com/blogs/compute/upcoming-updates-to-the-aws-lambda-execution-environment/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthbley%2Fphp-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthbley%2Fphp-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthbley%2Fphp-lambda/lists"}