{"id":21305776,"url":"https://github.com/araines/serverless-php","last_synced_at":"2025-07-11T21:31:10.640Z","repository":{"id":78051876,"uuid":"88280965","full_name":"araines/serverless-php","owner":"araines","description":"PHP for AWS Lambda via Serverless Framework","archived":false,"fork":false,"pushed_at":"2018-02-14T14:20:53.000Z","size":8419,"stargazers_count":149,"open_issues_count":7,"forks_count":22,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-06-09T16:06:29.585Z","etag":null,"topics":["php","serverless","serverless-framework"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"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/araines.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2017-04-14T15:47:04.000Z","updated_at":"2025-05-27T09:14:43.000Z","dependencies_parsed_at":"2023-02-24T08:00:35.589Z","dependency_job_id":null,"html_url":"https://github.com/araines/serverless-php","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/araines/serverless-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araines%2Fserverless-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araines%2Fserverless-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araines%2Fserverless-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araines%2Fserverless-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/araines","download_url":"https://codeload.github.com/araines/serverless-php/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/araines%2Fserverless-php/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264902230,"owners_count":23681025,"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":["php","serverless","serverless-framework"],"created_at":"2024-11-21T16:19:23.901Z","updated_at":"2025-07-11T21:31:10.383Z","avatar_url":"https://github.com/araines.png","language":"PHP","readme":"# serverless-php\n[![serverless][badge-serverless]](http://www.serverless.com)\n[![language][badge-language]](http://php.net)\n[![license][badge-license]](LICENSE)\n\nPHP for AWS Lambda via Serverless Framework using Symfony components for\ndependency injection.\n\n**Latest version is on [master][git-repo]**.\n\n[AWS Lambda][aws-lambda-home] lets you run code without thinking about servers.\nRight now you can author your AWS Lambda functions in several langauges\n[natively][aws-lambda-langs], but not PHP. This project aims to provide a fully\nfeatured shim for authoring your AWS Lambda functions in PHP.\n\nMore information about how this works and its performance characteristics can\nbe found on [my blog post][blog].\n\n## Preview\n```php\n\u003c?php\n\nuse Raines\\Serverless\\Context;\nuse Raines\\Serverless\\Handler;\n\nclass HelloHandler implements Handler\n{\n    public function handle(array $event, Context $context)\n    {\n        return [\n            'statusCode' =\u003e 200,\n            'body' =\u003e 'Hello World!',\n        ];\n    }\n}\n```\n\n\n# Features\n[Event Data](#Event-Data)   | [Context](#Ccontext)        | [Logging](#Logging)         | [Exceptions](#Exceptions)   | [Environment](#Environment)   | [API Gateway](#Api-Gateway)\n:-------------------------: | :-------------------------: | :-------------------------: | :-------------------------: | :---------------------------: | :-------------------------:\n![full][badge-support-full] | ![full][badge-support-full] | ![part][badge-support-part] | ![none][badge-support-none] | ![full][badge-support-full]   | ![full][badge-support-full]\n\n\n# Usage\n## Prerequisites\n* [Serverless](https://serverless.com/)\n* [Node](https://nodejs.org)\n* [Composer](https://getcomposer.org/)\n* [Git LFS](https://git-lfs.github.com/)\n\nInstall this project:\n```\nserverless install --url https://github.com/araines/serverless-php\n```\n\nCurrently `serverless install` does not work with [Git LFS](https://git-lfs.github.com/).\nHopefully this will be [supported in the future](https://github.com/serverless/serverless/issues/4611),\nbut for the moment here are your options:\n\n1. Rebuild the PHP binary (described later in this document)\n2. Download the PHP binary directly from [GitHub](https://github.com/araines/serverless-php/raw/master/php)\n3. Instead of using `serverless install`, ensure you have Git LFS installed on\nyour system and clone the repository.\n\n## Deploying to AWS\n```\ncomposer install -o --no-dev\nserverless deploy\n```\n\n## Running locally\n```\nserverless invoke local -f hello\n```\n\n## Running on AWS\n```\nserverless invoke -f hello\n```\n\n\n# Rebuilding PHP Binary\nThe PHP binary can be built with any flags you require and at any version.\n\n## Prerequisites\n* [Docker](https://www.docker.com/)\n\n## Compiling\n```\nsh buildphp.sh\n```\n\n## Altering compile flags etc\nEdit `buildphp.sh` and `dockerfile.buildphp` to alter it.\n\n\n# Thanks\n* [Robert Anderson][git-zerosharp] for the inspiration and base for this project\n\n\n[badge-serverless]:   http://public.serverless.com/badges/v3.svg\n[badge-language]:     https://img.shields.io/badge/language-php-blue.svg\n[badge-license]:      https://img.shields.io/badge/license-MIT-orange.svg\n[badge-support-full]: https://img.shields.io/badge/support-full-green.svg\n[badge-support-part]: https://img.shields.io/badge/support-partial-yellow.svg\n[badge-support-none]: https://img.shields.io/badge/support-none-red.svg\n\n[aws-lambda-home]:  https://aws.amazon.com/lambda/\n[aws-lambda-langs]: http://docs.aws.amazon.com/lambda/latest/dg/lambda-app.html#lambda-app-author\n\n[git-repo]:      https://github.com/araines/serverless-php\n[git-zerosharp]: https://github.com/ZeroSharp/serverless-php\n\n[blog]: https://medium.com/@araines/serverless-php-630bb3e950f5\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faraines%2Fserverless-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faraines%2Fserverless-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faraines%2Fserverless-php/lists"}