-
Notifications
You must be signed in to change notification settings - Fork 295
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
Customizing php.ini #11
Comments
I think it is a nice one to add to the roadmap, especially for use cases like you just mentioned. And as always, if you would like, open a PR with this feature 😉 |
Awesome! Sure, I'll try to get my head around the code base and see if I can do that. |
Hi guys. I like the idea. Could you please elaborate about the configuration?
|
Wow I was just about to post this: The three options I can think of:
{
"version": 2,
"builds": [
{
"src": "index.php",
"use": "now-php@canary",
"config": {
"composer": true,
"php.ini": {
"session.save_handler": "redis",
"session.save_path": "tcp://127.0.0.1:6379"
}
}
}
]
} I'm in favor of the option 3 to keep everything in one place. I think something like this https://github.com/npm/ini can help a lot. |
In a "normal" *nix environment, you usually extend configuration files by adding multiple files in a Also, I don't think it is needed to filter only "supported" directives, as they need to be updated with every extension update. The user probably notices from the build process if they entered some non supported value. I'm not convinced about putting the directives directly in now.json as this can get quite big fast. A simple If you have other opinions and/or insights, please share them 😊 |
This makes total sense. Similar to what docker-compose.yml does with the Dockerfile. it looks neat. |
I think adding extensions a different problem. As I have understood so far @f3l1x added as much extensions as he could to this builder. Maybe in the future there will be ways to specifically select which ones you want in your builder (or by composer.json?) This can make the resulting lambda smaller (= faster cold starts). But for now if someone whats to add an extension, I guess they have to create a PR with the binary (which is not safe because there could be anything in it 😐, so maybe a build folder for all the extensions and tools needs to be added to this repository. Also makes updates easier i guess.) |
@ties-v oh I see. I think this a Lambda related problem. Having to supply a binary artifact makes things hard to customize. This is what I miss about Docker 🙃. I did some digging though and found this: https://github.com/awslabs/aws-lambda-container-image-converter . Apparently we can convert a Docker image to a Lambda binary 🤯. This will solve all the customization problems (giving that the input is a Docker file). But I'm still thinking of how this could be mashed up with now-php. |
I have copy&paste already build PHP modules+libs by my self. https://github.com/juicyfx/now-builders/tree/master/src/php-lib Still thinking about to take to this repo or separate to solo repository. Maybe others can build a layer from this builded php. I like awslabs/aws-lambda-container-image-convert, @Malihs, can you please test it how it works? |
@f3l1x have you seen this example? https://github.com/awslabs/aws-lambda-container-image-converter/tree/master/example : Basically they're using Docker to build a php runtime that would work along with the current lambda OS ( php.ini might be factored in simply by copying it to The built up image could be run locally (docker should be installed on the machine) . hope this makes it clearer. I was about to reproduce this locally but we decided to steer away from Now Monorepo for the time being. |
Hi everyone, great work on this btw! I need to be able to set things in I personally would love just a simple way to set |
I'm thinking also about some option in |
@mdegrees @calebporzio @ties-v Can you please test it? #17 |
{
"version": 2,
"name": "now-php-ini",
"scope": "juicyfx",
"regions": [
"all"
],
"public": true,
"builds": [
{
"src": "*.php",
"use": "now-php@experimental",
"config": {
"php.ini": {
"memory_limit": "128M",
"post_max_size": "32M"
}
}
}
],
"build": {
"env": {
"NOW_PHP_DEBUG": "1"
}
}
} |
@f3l1x working like a charm, thank you! |
Sorry, I didn't get back to you sooner. Thanks @f3l1x - you're the man! |
Will there be support for php.ini customization? I'm specifically looking to set session handler to redis store. Thank you.
The text was updated successfully, but these errors were encountered: