4 ms·
A few weeks ago I created a small framework called lambdaphp[1]. The site https://www.lambdaphp.host/ https://www.lambdaphp.host/ is hosted on AWS lambda only!
by superasn 9y ago
A few weeks ago I created a small framework called lambdaphp[1]. The site https://www.lambdaphp.host/ https://www.lambdaphp.host/ is hosted on AWS lambda only!
My aim was to host a Wordpress or Laravel site on AWS lambda without paying any monthly hosting charges. I got everything running on it (sessions, fs, request, etc).
Some things are different though, like when you write to a file using file_put_contents, etc it writes to a S3 bucket instead of fs (thanks to PHP's S3 wrapper), or when you create a session, it uses AWS DynamoDB to do that behind the scenes.
I've created some examples like this sign-in example which uses AWS Cognito + AWS lambda to create a login/signup page[2], file uploader, etc[3].
Of course my project was just for my own amusement but I think this can be good for side project where you just want to host something and forget about it.
[1] https://github.com/san-kumar/lambdaphp https://github.com/san-kumar/lambdaphp
[2] https://www.lambdaphp.host/examples/auth/ https://www.lambdaphp.host/examples/auth/
[3] https://github.com/san-kumar/lambdaphp#examples https://github.com/san-kumar/lambdaphp#examples
- alexellisuk 9y agoThis is a very neat project. For those folks where this doesn't quite fit and you want the serverless experience checkout OpenFaaS and our PHP template too - https://github.com/openfaas/faas https://github.com/openfaas/faas https://github.com/openfaas/faas-cli#templates https://github.com/openfaas/faas-cli#templates we use composer for installing components at build time with Docker (not on your host system directly)
- superasn 9y agoThank you. Also just want to mention that as per AWS's recent announcement they are going to make Amazon RDS lambda like, i.e. You dont have to pay monthly for your Mysql server but query wise or Cpu consumption wise.
- insomniacity 9y agoThat sounds interesting - do you have a link?
- wiredfool 9y agohttps://aws.amazon.com/blogs/aws/in-the-works-amazon-aurora-serverless/ https://aws.amazon.com/blogs/aws/in-the-works-amazon-aurora-... Only in preview, only in us-east-1, Aurora mysql flavor. Other regions/flavor to follow.
- RyanShook 9y agoCan you deploy a functional Wordpress blog on Lambda? Would love to try it.
- viraptor 9y agoWordPress depends heavily on a relational database, so hosting just on lambda would be hard.
- superasn 9y agoI certainly hope so though I haven't tried it myself. I've managed to get the sessions, routing, fs, etc working just fine without any additional configuration, but of course there will be some quirks during the actual Wordpress installation which I haven't explored yet. Maybe next week I will try it :)
- RyanShook 9y agoFound this AWS migration tool for Wordpress. Uses Lambda along with S3. https://github.com/mscifo/pressless https://github.com/mscifo/pressless