Open benzoh opened 2 years ago
It all looks correct. You should probably also add oci8 layer in your artisan function.
What version of bref/extra-php-extensions are you running? Looking at your second screenshot , the "compatible runtimes" seams weird.
Btw, the layer is verified with: https://github.com/brefphp/extra-php-extensions/blob/master/layers/oci8/test.php
Thank you for your reply.
But I can't increase the runtime version of the extension.
Isn't it necessary to set the parameter here to PROVIDED_AL_2?
FYI: This layer was just updated by @Nemo64
I didn't touch the oci8
layer, I modified the odbc-snowflake
layer.
Oh, Im confused.
Sorry for the ping
I have the same issue, did you solve it @benzoh ?
@renanwilliam yes. I solved it by defining the layers myself. Please have a look.
serverless.yml
looks like this.
functions:
app:
handler: public/index.php
layers:
- ${bref:layer.php-80-fpm}
- arn:aws:lambda:ap-northeast-1:XXXXXXXXXXXX:layer:lambda-oci8-layer:3
events:
- http:
path: api/hoge
method: GET
Strange, your Dockerfile looks like the same in the official repo. Is there something relevant different that I was not seeing?
I think the solution is to publish with the PROVIDED_AL_2
runtime. I published layer with --compatible-runtimes provided.al2
options.
aws lambda publish-layer-version \
--layer-name lambda-oci8-layer \
--description "My oci8 layer" \
--license-info "MIT" \
--zip-file fileb://dest/oci8.zip \
--compatible-runtimes provided.al2 \
--compatible-architectures x86_64
I am getting this error : 'user' directive is ignored when FPM is not running as root. Below is my function code in serverless.yml c-api: handler: index.php description: '' timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds) layers:
Hello. Let me ask you a question. I think I've defined the extension correctly, but it doesn't work.
↓ serverless.yml
Do I need to set anything else?