简体   繁体   English

AWS Lambda php生成EACCESS

[英]AWS Lambda php spawn EACCESS

I've been stuck for quite some time now and I looked through similar posts here and what I have managed to google. 我已经被困了很长时间了,我在这里浏览了类似的帖子以及我设法在Google上找到的内容。

My goal is to run a PHP function on lambda, nothing fancy, I just followed all the steps as laid out in here https://aws.amazon.com/blogs/compute/scripting-languages-for-aws-lambda-running-php-ruby-and-go/ 我的目标是在lambda上运行一个PHP函数,没什么花哨的,我只是按照这里https://aws.amazon.com/blogs/compute/scripting-languages-for-aws-lambda-running中列出的所有步骤进行操作-php,红宝石和去/

Error message I get when i run test is: 运行测试时收到的错误消息是:

{
    "errorMessage": "RequestId: 832ee5e0-e7f6-11e8-bde8-b7d0d5da71bc Process exited before completing request"
}

And log is : 日志是:

START RequestId: 832ee5e0-e7f6-11e8-bde8-b7d0d5da71bc Version: $LATEST
2018-11-14T10:17:39.019Z 832ee5e0-e7f6-11e8-bde8-b7d0d5da71bc Error: spawn EACCES

    at _errnoException (util.js:1022:11)
    at ChildProcess.spawn (internal/child_process.js:323:11)
    at exports.spawn (child_process.js:502:9)
    at exports.handler (/var/task/php.js:8:15)
END RequestId: 832ee5e0-e7f6-11e8-bde8-b7d0d5da71bc
REPORT RequestId: 832ee5e0-e7f6-11e8-bde8-b7d0d5da71bc  Duration: 56.44 ms  Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 20 MB  RequestId: 832ee5e0-e7f6-11e8-bde8-b7d0d5da71bc Process exited before completing request

So as I thought the problem was that ('Error: spawn EACCES') permissions on binaries after i zip it on my windows 10 machine were missing so i tried adding zip to my git-bash and zip with it zip -r lambda.zip php-7-bin php.js helloLambda.php but it did not work either. 所以我以为问题是我在Windows 10计算机上将其压缩后对二进制文件的错误(“错误:生成EACCES”),所以我尝试将zip添加到我的git-bash并使用zip -r lambda.zip php-7-bin php.js helloLambda.php但它也不起作用。

And now I am out of ideas, thinking maybe someone else might know what's wrong. 现在我没主意了,想也许其他人可能知道出了什么问题。

I made it work. 我成功了 Created both php.js and helloLambda.php on ec2 instance (with nano) like PHP binary and zip'ed em in that environment. 在ec2实例(使用nano)上创建了php.js和helloLambda.php,例如在该环境中的PHP二进制文件和zip'ed em。 After that I downloaded .zip to my windows machine and uploaded it to lambda function. 之后,我将.zip下载到我的Windows计算机上,并将其上传到lambda函数。

Too bad they don't mention (in amazon tutorial) that creating files on windows doesn not give them needed permissions. 遗憾的是,他们没有提到(在Amazon教程中)在Windows上创建文件并没有赋予他们所需的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM