PHP runtime for AWS Lambda
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

32 lines
823 B

#! /bin/bash
rm -rf runtime
mkdir -p runtime/{bin,etc,lib,ext}
cp bootstrap runtime/
cp ~/php-7.4.0RC6-build/bin/php runtime/bin/
cp ~/php-7.4.0RC6/php.ini-production runtime/etc/php.ini
cp ~/php-7.4.0RC6-build/lib/php/extensions/no-debug-non-zts-20190902/* runtime/ext/
echo "extension_dir=/opt/ext" >> runtime/etc/php.ini
echo "extension=redis.so" >> runtime/etc/php.ini
echo "extension=opcache.so" >> runtime/etc/php.ini
for lib in libncurses.so.5 libtinfo.so.5 libpcre.so.0; do
cp "/lib64/${lib}" runtime/lib/
done
for lib in libonig.so.2; do
cp "/usr/lib64/${lib}" runtime/lib/
done
curl -sS https://getcomposer.org/installer | runtime/bin/php
runtime/bin/php composer.phar require aws/aws-sdk-php
cd runtime
zip -r runtime.zip *
mv runtime.zip ../
cd ..
zip -r vendor.zip vendor
zip -r lambda.zip src