Slide 1

Slide 1 text

Serverless PHP 
 Bref PHP 2023 2 0 23 . 9 . 16 @seike 4 60 1

Slide 2

Slide 2 text

@seike 46 0 - - @seike 46 0 - AWS Community Builder Serverless - Fusic - / - / - - PHP - PHP - PHP - - 055538A - B 2 2

Slide 3

Slide 3 text

Agenda 1 .Serverless PHP 2 .Bref 3 .OSS 4 .Bref 5 . 3

Slide 4

Slide 4 text

01 Serverless PHP

Slide 5

Slide 5 text


 
 
 Cloud Native Computing Foundation CNCF Serverless Whitepaper v 1 . 0 https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview 5

Slide 6

Slide 6 text

FaaS 6 FaaS(Function as a Service) AWS AWS Lambda Azure Azure Functions 
 GCP Google Cloud Functions Google Cloud Run AWS Lamnda PHP

Slide 7

Slide 7 text

02 Bref

Slide 8

Slide 8 text

Bref Bref PHP OSS AWS Lambda PHP AWS Lambda PHP PHP 
 PHP Bref PHP 
 PHP AWS Lambda Laravel Symfony PHP CLI 8

Slide 9

Slide 9 text


 
 Developer Community AWS Lambda 
 PHP PHP Deploy 
 PHPer 
 Bref 9 service: app-phpcon-okinawa provider: name: aws region: ap-northeast- 1 plugins: - ./vendor/bref/bref functions: api: handler: index.php description: '' runtime: php- 8 2 -fpm timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds) events: - httpApi: '*' # Exclude files from deployment package: patterns: - '!node_modules/**' - '!tests/**' $ composer require bref/bref $ vendor/bin/bref init

Slide 10

Slide 10 text

10 HTTP Bref Pull PHP Bref

Slide 11

Slide 11 text

03 OSS 


Slide 12

Slide 12 text

OSS 12 Bref OSS OSS OSS Bref GitHub Class

Slide 13

Slide 13 text

04 Bref

Slide 14

Slide 14 text


 runtime 14

Slide 15

Slide 15 text

Runtime README 
 15

Slide 16

Slide 16 text

brefphp/aws-lambda-layers runtime 
 php- 83 16

Slide 17

Slide 17 text

Dockerfile bootstrap 
 bootstrap AWS Lambda 
 
 
 17

Slide 18

Slide 18 text

bootstrap RUNTIME_CLASS 
 Class run 18

Slide 19

Slide 19 text

GitHub php-fpm 19

Slide 20

Slide 20 text

run() php-fpm processNextEvent Php-fpm Event 20

Slide 21

Slide 21 text

Invoke HTTP Invoke HTTP 
 21

Slide 22

Slide 22 text

HTTP Handler HTTP Handler 
 handle 22

Slide 23

Slide 23 text

Response HTTP Request Object Request handling response API Gateway 
 Response 23

Slide 24

Slide 24 text

HTTP Request Event QueryString header 24

Slide 25

Slide 25 text

toApiGatewayFormat API Gateway ⾒ 
 Cookie header 
 Body 25

Slide 26

Slide 26 text

26 Bref AWS Lambda API Gateway 
 
 Bref AWS Lambda 
 AWS APIGatewayV 2 HTTPEvent Bref Lambda

Slide 27

Slide 27 text

Coverage by Bref 27 Bref AWS 
 


Slide 28

Slide 28 text

04

Slide 29

Slide 29 text

29 Bref PHP Point 1 Bref Event PHP Point 2 AWS Point 3 Point 4

Slide 30

Slide 30 text

Thank You We are Hiring ! https://recruit.fusic.co.jp/