A handler is the method in your PHP function code that processes requests. When Function Compute invokes your function, it runs the handler method you configured.
Handler naming
PHP handlers must follow the <filename>.<methodname> format — without the .php extension.
For example, if your file is named main.php and the entry method is handler, set the Request Handler value to main.handler.
Set the handler in the console
Open the Function Compute console and go to your function.
Find the Request Handler field.
Enter the handler name in
<filename>.<methodname>format.Save the configuration.
Handler types
Function Compute supports two handler types:
| Handler type | Trigger | Reference |
|---|---|---|
| Event handler | Event sources | Event handlers |
| HTTP handler | HTTP triggers | PHP HTTP functions |
Configuration requirements differ between handler types. For an overview of both function types, see Function types.
What's next
Manage functions — create and configure functions in the console
Deploy a code package — package your PHP code with dependencies and deploy it to Function Compute