16

I am running the following solution from AWS Lambda,

https://aws.amazon.com/blogs/apn/aws-lambda-custom-runtime-for-php-a-practical-example/

While testing the lambda function.

sudo aws lambda invoke --function-name php-example-hello --region us-east-1 --log-type Tail --query 'LogResult' --output text --payload '{"name": "World"}' hello-output.txt | base64 --decode

I am getting the following error,

START RequestId: 29f05ee2-a003-45f4-9700-97a9ac33a528 Version: $LATEST
END RequestId: 29f05ee2-a003-45f4-9700-97a9ac33a528
REPORT RequestId: 29f05ee2-a003-45f4-9700-97a9ac33a528  Duration: 54.09 ms      Billed Duration: 100 ms         Memory Size: 128 MB     Max Memory Used: 12 MB
RequestId: 29f05ee2-a003-45f4-9700-97a9ac33a528 Error: Runtime failed to start: fork/exec /opt/bootstrap: no such file or directory
Runtime.ExitError

Any help will be appreciated.

Kappa
  • 1,015
  • 1
  • 16
  • 31
  • 2
    `/opt/bootstrap: no such file or directory` implies your `runtime.zip` is incorrect - can you list the contents of that file in your post? – Sjon Jul 19 '19 at 11:28

2 Answers2

5

In AWS Lambda there is an answer it says check deployment again to steps and check result sometimes it's not probabily make dir so you can create yourself or you have to check permissions.

zip -r runtime.zip bin bootstrap
zip -r vendor.zip vendor/
zip hello.zip src/hello.php
zip goodbye.zip src/goodbye.php

enter image description here

1

Ensure you ran chmod +x on bootstrap.

chmod +x bootstrap
Dave
  • 1,356
  • 10
  • 15