san-kumar / lambdaphp Goto Github PK
View Code? Open in Web Editor NEWQuick and Dirty PHP website hosting using Aws Lambda
License: GNU General Public License v3.0
Quick and Dirty PHP website hosting using Aws Lambda
License: GNU General Public License v3.0
Hey there!
I'd like to report a security issue but cannot find contact instructions on your repository.
If not a hassle, might you kindly add a SECURITY.md
file with an email, or another contact method? GitHub recommends this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future.
Thank you for your consideration, and I look forward to hearing from you!
(cc @huntr-helper)
I'm seeing this error on deploy. I'm not sure where to get/build the layer with PHP?
$> vendor/bin/lambdaphp deploy -v
Gathering AWS credentials
Created zip: /private/var/folders/bv/8tvsw5h155v_2_dwj1fjkl_h0000gn/T/zipqKrgWz.zip, /private/var/folders/bv/8tvsw5h155v_2_dwj1fjkl_h0000gn/T/zipjY956m.zip
Setting up IAM permissions
Found existing IAM role
Creating new lambda function (this may take a while)
In WrappedHttpHandler.php line 195:
[Aws\Lambda\Exception\LambdaException]
Error executing "CreateFunction" on "https://lambda.us-east-1.amazonaws.com/2015-03-31/functions"; AWS HTTP error: Client error: POST https://lambda.us-east-1.amazonaws.com/2015-03-31/functions
resulted in a 400 Bad Request
response:
{"Type":"User","message":"Layer version arn:aws:lambda:us-east-1:322173628904:layer:php:10 does not exist."}
InvalidParameterValueException (client): Layer version arn:aws:lambda:us-east-1:322173628904:layer:php:10 does not exist. - {"Type":"User","message":"Layer version arn:aws:lambda:us-east-1:322173628904:layer:php:10 does not exist."}
>httpd -t
is showing "Syntax Ok", but while deploying lambdaphpapp, I am getting error
In WrappedHttpHandler.php line 191:
[Aws\Iam\Exception\IamException]
Error executing "CreateRole" on "https://iam.amazonaws.com"; AWS HTTP error: cURL error 60: SSL certificate problem
: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
Can you please help me here?
When working in regions outside of eu-west-1 - the output URL shows eu-west-1 rather than the configured region.
Hi San Kumar
I've been playing with this package and it's excellent, thank you for creating it.
I've been having trouble using mysqli, it seems like this isn't included, but I may be mistaken. It'd be a great addition though, as it must be one of the more widely used PHP extensions. Would it be possible to add it in please.
Thanks
Andy
I'm finding issues deploying on unix/linux from the latest composer which would suggest its been edited using a windows format and not cleaned prior to commit.
find . -type f -exec dos2unix {} \;
This is resulting in a broken deploy function on unix/linux os
It seems that the latest version of lambdaphp v0.01 will only run in region "us-east-1", as apparently all layers of a lambda must be within the same region and the PHP layer only exists in "us-east-1". Is there a way to create layers for all regions, or failing that some instructions on how to create a PHP layer for the region we are using (ap-southeast-2)?
awsuser@VPS:~/awstest# lambdaphp deploy -v
Creating zip file
Gathering AWS credentials
Updating lambda function (this may take a while)
PHP Notice: Undefined index: crontab in /awsuser/awstest/vendor/lambdaphp/installer/console/App/Config.php on line 55
PHP Warning: Invalid argument supplied for foreach() in /awsuser/awstest/vendor/lambdaphp/installer/console/App/Config.php on line 55
First, wow, what a great project! Thank you for making this.
Summary
In files such as ./vendor/bin/lambdaphp
there are windows line endings. Deploying on Linux therefore triggers fatal errors, and deployment cannot take place.
Steps To Reproduce
Follow the instructions to install and deploy using lambdaphp deploy -v
Expected Behaviour
Site should be deployed, with the script producing output similar to the following:
$ lambdaphp deploy -v
Creating zip file
Gathering AWS credentials
Setting up IAM permissions
Creating new IAM role
Setting S3 and DynamoDB access
Creating new lambda function (this may take a while)
Setting permissions for lambda function
Creating sessions table
Creating new REST API
Connecting REST API to Lambda function
Creating API methods for [some-id]
Creating API methods for [some-other-id]
Creating deployment for Rest API
Website deployed!
To access your site visit:
[url]
Actual Behaviour
Site does not get deployed, and the script terminates with the following output:
$ lambdaphp deploy -v
/usr/bin/env: ‘php\r’: No such file or directory
Solution
Change line endings to Unix (LF) line endings. The process then completes as expected.
Cheers
Geoff.
Please could you add a REST API example to your list of examples. It is not clear what API request data is being made available from the AWS API gateway, and also how to access such data in PHP.
Hi,
Any chance you can supply a sample lambdaphp.ini
? (it is ignored from the repo)
I'm keen to see the available options.
Thanks
Geoff.
In the FAQ section, it states:
FAQ
- Which PHP version will my site be running?
Currently it supports PHP 7.2.
However phpinfo()
from a live Lambda deployed 19 Oct 2018 shows an older PHP of 7.1.3.
How do I construct a more recent PHP build?
Thanks
Geoff.
First, awesome project. Came in super handy for me today and saved me a ton of time.
Would be great if you could indicate a specific profile when calling lambdaphp deploy -v
As it currently is you have to hack the getAwsConfig
function to get it to use a profile other than the default.
Maybe something like this:
lambdaphp deploy -v -p profile-name
The source vendor/lambdaphp/installer/console/Command/Deploy.php references nodejs8.10 which is no longer supported on AWS. How to update for nodejs10.x and nodejs12.x ?
Just wondering, is there any idea on how to deploy a website without using API Gateway? API Gateway is very expensive.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.