-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Works locally, but fails on AWS Lambda :( #15
Comments
Based on the error message you are getting ( The reason it is executing locally is because the Javascript wrapper uses your local system PHP binary when executing locally. Only once you are within the AWS Lambda environment will it use the PHP binary within the repository. You may be able to get somewhere with cygwin or similar (assuming that project still exists?) to get good old *nix power in a Windows environment. I assume you have already done this, but in case not -- as per the README, please ensure you have rebuilt the PHP binary via Docker or downloaded it directly from GitHub to ensure the file actually is a real binary file! Otherwise it definitely won't be executable. |
Actually this looks like a duplicate of the outstanding #10 - basically someone else having a problem with getting executable flags on files within Windows. |
Also if you do get this working, please do feedback how - it would be great to get the additional info on the README for those unfortunate enough to have to use Windows ;-). |
Hi @araines I had somewhat of a similar issue. I was trying to use the AWS S3 classes through your Serverless / Lambda configuration. At first it was working when invoked locally, but not when invoked on Lambda remotely. Kept saying that Anyway, thanks for contributing this project, it looks like it has potential to be extremely useful! I have only just gotten started using it and look forward to getting deeper.
|
Hi @robertcharlesfox thanks for the input - I think the issue you were facing was a little different to the one reported. Functions being undefined within PHP is very much down to the compiled libraries through the flags in the dockerfile, as you've rightly identified. :) However, the issue here seems to be specifically to do with actually executing the PHP binary once deployed to Lambda from a Windows machine. Either way, thanks for contributing and I'm glad this project is helping solve some problems for you! |
Dear Author,
Please help.
I have successfully installed and configured serverless-php on both local and AWS Lambda. The function works as expected locally but does not work when it is invoked over AWS Lambda.
When invoked locally, the execution is SUCCESSFUL. https://www.screencast.com/t/KfIVnmRdVOF
When invoked online, the execution FAILS. https://www.screencast.com/t/ptootyYsFATF
When executed from AWS Lambda, it FAILS. https://www.screencast.com/t/qxFTk77X2
Looks like the child process call from the handler.js file is not getting executed for some reason.
var proc = child_process.spawn(php, args, options);
My local system is a Windows 10 x64 machine. Not sure if it has anything to do with Windows.
I tried to find a solution for this but a lot of other people are also struggling in getting it to work properly. Please help me fix this issue.
Suggestion: If possible please do a video tutorial of getting serverless-php up and running for Windows 10.
Looking forward to an early response.
Thanks & regards,
Mohit
The text was updated successfully, but these errors were encountered: