In order to use PHP on AWS Lambda, the PHP binary, including the required libraries, has to be integrated into the app. To do this, we have to compile the PHP 7.1.0RC5 with statically linked libraries:
sh build_php_7.sh
We are using PHP 7.1.0RC5 to compile the PHP binary
To switch the PHP version you can set the Branch to checkout sources from a different branch
by editing the "PHP_VERSION_GIT_BRANCH param on sh build_php_7.sh
at line 8
You can run the NodeJs Unittest with "lambda-tester" by building and running the specific docker container:
docker build -t lambda-php-unittest -f Dockerfile.TestLambdaApp .
docker run lambda-php-unittest
To get the example application running on AWS you have to zip the php example script file, the NodeJS script file and the PHP binary together:
zip aws-lambda-php-example.zip index.js index.php php
Now you can create a new Lambda function on AWS and upload the ZIP package: