stackery / php-lambda-layer

PHP Runtime Layer for AWS Lambda
Other
321 stars 71 forks source link

Error building the php layer #26

Open jcombrex opened 5 years ago

jcombrex commented 5 years ago

Hello,

Thank you for the work on this lambda layer, this will be super useful for many people.

I'm trying to customize the php layer but when I compile it I get this error:

cp: cannot stat ‘/usr/lib64/libedit.so.0’: No such file or directory

The problem is located in the build.sh : cp /usr/lib64/libedit.so.0 lib/ It seems like the libedit.so.0 file does not exist in the image, yet I'm using the same lambci/lambda:build-nodejs8.10 and build.sh (with yum install -y php71-cli zip) you're using.

Any idea what I'm missing? Thank you!

txase commented 5 years ago

I'm not sure why it isn't working for you. I was able to build the image again just fine.

code-runner-2017 commented 5 years ago

You can open a bash shell in the docker container:

docker run --rm -it -v `pwd`:/opt/layer lambci/lambda:build-nodejs8.10 /bin/bash

and execute the build.sh line by line to track your problem. Do you get any error while executing the build commands? Before doing that, try to delete the image and download it again.

MashaFomina commented 5 years ago

Hello, I have the same error on latest version of lambci/lambda:build-nodejs8.10. /opt/bin/php: error while loading shared libraries: libedit.so.0: cannot open shared object file: No such file or directory During executing build-php-remi.sh manually I get this error (in system no libedit): cp: cannot stat ‘/usr/lib64/libedit.so.0’: No such file or directory

The reinstallation of packages solved this error: yum reinstall -y libedit libedit-devel

But my own runtime not work: Fatal error: Uncaught Error: Call to undefined function curl_init() in /opt/bootstrap:72

pcfreak30 commented 5 years ago

force reinstalling libedit works.

However, there are some wrong assumptions regarding file paths that cause the ini and extensions to not load. Still doing experiments as the latest release doesn't have mysqli loaded already.