16

我正在从 AWS Lambda 运行以下解决方案,

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

在测试 lambda 函数时。

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

我收到以下错误,

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

任何帮助将不胜感激。

4

2 回答 2

5

在 AWS Lambda 中有一个答案,它说再次检查部署到步骤并检查结果有时它可能不是 make dir 所以你可以自己创建或者你必须检查权限。

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

在此处输入图像描述

于 2019-07-21T11:52:48.673 回答
0

确保您chmod +x在引导程序上运行。

chmod +x bootstrap
于 2020-09-17T14:54:35.127 回答