brefphp / bref

Serverless PHP on AWS Lambda
https://bref.sh
MIT License
3.15k stars 365 forks source link

Pgsql extension and libpg.so #224

Closed prolic closed 3 years ago

prolic commented 5 years ago

I need to pgsql extension available, so I provided the pgsql.so in my lambda function. Problem is, the libpq.so.5 is not available on aws lambda, I tried to provide that as well, but then I received undefined symbol: executor_globals.

I don't know if it is possible to statically link the libpq dependency into pgsql when compiling the extension. Do you have any solution for this? (easiest way for me is of course, of you could provide the extension in the bref layer by default).

Thanks

mnapoli commented 5 years ago

Hi, just to be sure: the pdo_pgsql extension is available but not enabled by default. You should not have to provide pgsql.so. Have you tried enabling it via extension=pdo_pgsql directly?

prolic commented 5 years ago

I'm speaking of pgsql, not pdo_pgsql.

prolic commented 5 years ago

I could make it work using the pq extension instead using the libpq files from node-libpq (https://github.com/brianc/node-libpq/files/176483/libpq-static.zip). pgsql is not working, but with pq I have a replacement that works for me.

Unfortunately pdo_pgsql is not suitable for my usecase.

I leave the ticket open, in case you want to do anything about it. Otherwise, feel free to close it.

mnapoli commented 3 years ago

Done in https://github.com/brefphp/extra-php-extensions