# Serverless-PHP

## Introduction

We all know that PHP is one of the oldest, easiest scripting language for web application development, but when it comes to managing the application after deployment, we have to take care of servers, increasing traffic, cost management.&#x20;

To simplify this process we can make use of serverless computing. It offers a number of advantages over traditional cloud based computing infrastructure. For many developers, serverless architectures offer greater scalability, more flexibility, and quicker time to release, all at a reduced cost. With serverless architectures, developers do not need to worry about purchasing, provisioning, and managing backend servers, this is done by the providers like AWS Lambda, Google Cloud Functions.

But in this era of serverless development we don't see PHP as a default platform for developing serveless applications on provider like AWS  Lambda.

Its a little complicated task for a newbie to deploy a serverless application on AWS lambda by creating own runtime environment and implementing it on Lambda platform.

For simplying this process we are going to use **Bref** (<https://bref.sh>). Bref uses [the Serverless framework](https://serverless.com/) to configure and deploy serverless applications. Being the most popular tool, Serverless comes with a huge community, a lot of examples online and a simple configuration format. You can take a look at documentation on [https://bref.sh/docs](https://bref.sh/docs/) for more information about Serverless and Bref platforms.

## Why Serverless-PHP?

Serverless-PHP is a simple, lightweight, and object oriented framework based on Bref, which simplifies the application development process using handlers (similar to the Components in Angular Framework) on AWS using Lambda Functions and API Gateway.

Serverless-PHP manages requests from API Gateway, their routing, and formats response to return from the function to the user through API Gateway. &#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sachink23.gitbook.io/serverless-php/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
