`bref-extra:oci8-php-80` doesn't work
Hello. Let me ask you a question. I think I've defined the extension correctly, but it doesn't work.
↓ serverless.yml
functions:
# This function runs the Laravel website/API
web:
handler: public/index.php
timeout: 28 # in seconds (API Gateway has a timeout of 29 seconds)
layers:
- ${bref:layer.php-74-fpm}
- ${bref-extra:oci8-php-80}
events:
- httpApi: '*'
# This function lets us run artisan commands in Lambda
artisan:
handler: artisan
timeout: 120 # in seconds
layers:
- ${bref:layer.php-74} # PHP
- ${bref:layer.console} # The "console" layer
plugins:
# We need to include the Bref plugin
- ./vendor/bref/bref
- ./vendor/bref/extra-php-extensions



Do I need to set anything else?
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: - ${bref:layer.php-80-fpm} - arn:aws:lambda:us-east-1:553035198032:layer:gcc72-lambda1:4