From 51051dd5f21d6d4982eeb7c59de3810b5dc2eae0 Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Wed, 15 May 2019 08:22:24 -0700 Subject: [PATCH 01/10] Update README.md for included extensions in PHP 7.3 --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/README.md b/README.md index c6d8b71..f8bf556 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,33 @@ Replace ${PHP_VERSION} with '7.3', or '7.1' according to your preferred runtime. ##### Extensions The following extensions are built into the layer and available in /opt/lib/php/${PHP_VERSION}/modules: +PHP 7.3 Layer: +``` +bz2.so +calendar.so +ctype.so +curl.so +exif.so +fileinfo.so +ftp.so +gettext.so +iconv.so +json.so +mbstring.so +mysqli.so +mysqlnd.so +pdo.so +pdo_mysql.so +pdo_pgsql.so +pdo_sqlite.so +pgsql.so +phar.so +sockets.so +sqlite3.so +tokenizer.so +``` + +PHP 7.1 Layer: ``` bz2.so calendar.so From 28e6e8d9160b381218e57ea6c2aafa1a8d43c6ce Mon Sep 17 00:00:00 2001 From: Tito Costa Date: Wed, 29 May 2019 10:46:45 +1200 Subject: [PATCH 02/10] fixed issue with installing remi repo and added the php xml and process extensions --- build-php-remi.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build-php-remi.sh b/build-php-remi.sh index c0d0ee0..9c6ae8f 100755 --- a/build-php-remi.sh +++ b/build-php-remi.sh @@ -8,9 +8,8 @@ yum install -y wget yum install -y yum-utils wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm wget https://rpms.remirepo.net/enterprise/remi-release-6.rpm -rpm -Uvh remi-release-6.rpm rpm -Uvh epel-release-latest-6.noarch.rpm - +rpm -Uvh remi-release-6.rpm yum-config-manager --enable remi-php7${PHP_MINOR_VERSION} @@ -18,7 +17,7 @@ yum install -y httpd yum install -y postgresql-devel yum install -y libargon2-devel -yum install -y --disablerepo="*" --enablerepo="remi,remi-php7${PHP_MINOR_VERSION}" php php-mbstring php-pdo php-mysql php-pgsql +yum install -y --disablerepo="*" --enablerepo="remi,remi-php7${PHP_MINOR_VERSION}" php php-mbstring php-pdo php-mysql php-pgsql php-xml php-process mkdir /tmp/layer From b507b5ec648ae99f393bb43fa0a69103687d2dd1 Mon Sep 17 00:00:00 2001 From: Tito Miguel Costa Date: Sat, 1 Jun 2019 09:26:52 +1200 Subject: [PATCH 03/10] updated readme with list of extensions provided on php 7.3 --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f8bf556..5e47a4a 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ bz2.so calendar.so ctype.so curl.so +dom.so exif.so fileinfo.so ftp.so @@ -52,15 +53,26 @@ json.so mbstring.so mysqli.so mysqlnd.so -pdo.so pdo_mysql.so pdo_pgsql.so +pdo.so pdo_sqlite.so pgsql.so phar.so +posix.so +shmop.so +simplexml.so sockets.so sqlite3.so +sysvmsg.so +sysvsem.so +sysvshm.so tokenizer.so +wddx.so +xmlreader.so +xml.so +xmlwriter.so +xsl.so ``` PHP 7.1 Layer: From 9daecf19d9e1f0ed2a0dc080b955cbc585e721a6 Mon Sep 17 00:00:00 2001 From: Keitaroh Kobayashi Date: Mon, 24 Jun 2019 17:36:59 +0900 Subject: [PATCH 04/10] Add libonig.so.5 for mbstring --- build-php-remi.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-php-remi.sh b/build-php-remi.sh index 9c6ae8f..cb2f71d 100755 --- a/build-php-remi.sh +++ b/build-php-remi.sh @@ -36,6 +36,7 @@ done cp /usr/lib64/libedit.so.0 lib/ cp /usr/lib64/libargon2.so.0 lib/ cp /usr/lib64/libpq.so.5 lib/ +cp /usr/lib64/libonig.so.5 lib/ mkdir -p lib/php/7.${PHP_MINOR_VERSION} cp -a /usr/lib64/php/modules lib/php/7.${PHP_MINOR_VERSION}/ From 5afa317d8033af21f2789d5e2ddd819858d79a96 Mon Sep 17 00:00:00 2001 From: Keitaroh Kobayashi Date: Tue, 25 Jun 2019 10:18:53 +0900 Subject: [PATCH 05/10] Send body regardless of what the HTTP method is. This allows PUT and PATCH requests, for example. --- bootstrap | 8 +------- build-php-remi.sh | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/bootstrap b/bootstrap index 91969bd..fddbc5c 100755 --- a/bootstrap +++ b/bootstrap @@ -171,13 +171,7 @@ while (true) { } if (strlen($body) > 0) { - if($event['httpMethod'] === 'POST'){ - curl_setopt($ch, CURLOPT_POSTFIELDS, $body); - } - curl_setopt($ch, CURLOPT_INFILESIZE, strlen($body)); - curl_setopt($ch, CURLOPT_READFUNCTION, function ($ch, $fd, $length) use ($body) { - return $body; - }); + curl_setopt($ch, CURLOPT_POSTFIELDS, $body); } $response = array(); diff --git a/build-php-remi.sh b/build-php-remi.sh index cb2f71d..8d8fbef 100755 --- a/build-php-remi.sh +++ b/build-php-remi.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/bash -e PHP_MINOR_VERSION=$1 From a553e85cc538ef5add73176af6269e283969ffaa Mon Sep 17 00:00:00 2001 From: Keitaroh Kobayashi Date: Mon, 24 Jun 2019 15:56:34 +0900 Subject: [PATCH 06/10] Fix redirecting from PHP --- bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index fddbc5c..5fcf610 100755 --- a/bootstrap +++ b/bootstrap @@ -145,7 +145,7 @@ while (true) { $ch = curl_init("http://localhost:8000$uri"); - curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, FALSE); if (array_key_exists('multiValueHeaders', $event)) { $headers = array(); From a6dc45ebf453fd4f5daa569cd9544b75c5d15e52 Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Tue, 2 Jul 2019 16:12:17 -0700 Subject: [PATCH 07/10] Build with updated lambci 'provided' images --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4057a87..eee5fce 100644 --- a/Makefile +++ b/Makefile @@ -3,10 +3,10 @@ ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST)))) all: php71.zip php73.zip php71.zip: - docker run --rm -e http_proxy=${http_proxy} -v $(ROOT_DIR):/opt/layer lambci/lambda:build-nodejs8.10 /opt/layer/build.sh + docker run --rm -e http_proxy=${http_proxy} -v $(ROOT_DIR):/opt/layer lambci/lambda:build-provided /opt/layer/build.sh php73.zip: - docker run --rm -e http_proxy=${http_proxy} -v $(ROOT_DIR):/opt/layer lambci/lambda:build-nodejs8.10 /opt/layer/build-php-remi.sh 3 + docker run --rm -e http_proxy=${http_proxy} -v $(ROOT_DIR):/opt/layer lambci/lambda:build-provided /opt/layer/build-php-remi.sh 3 upload71: php71.zip ./upload.sh 7.1 From 90b4d55e6b3b4d1c389e37af9a74b819bf0b486e Mon Sep 17 00:00:00 2001 From: Chase Douglas Date: Tue, 2 Jul 2019 15:11:56 -0700 Subject: [PATCH 08/10] Release new layer versions 7.3: 3 7.1: 10 --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5e47a4a..f71456d 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,9 @@ This is an early iteration of the PHP runtime Layer which is not yet ready for p ## Current Layer Version ARN When creating/updating a Lambda function you must specify a specific version of the layer. This readme will be kept up to date with the latest version available. The latest available Lambda Layer Version ARNs for PHP 7.3 and 7.1 are: -**arn:aws:lambda:\:887080169480:layer:php73:2** +**arn:aws:lambda:\:887080169480:layer:php73:3** -**arn:aws:lambda:\:887080169480:layer:php71:9** +**arn:aws:lambda:\:887080169480:layer:php71:10** See [Releases](https://github.com/stackery/php-lambda-layer/releases) for release notes. @@ -144,7 +144,7 @@ Resources: Timeout: 30 Tracing: Active Layers: - - !Sub arn:aws:lambda:${AWS::Region}:887080169480:layer:php73:2 + - !Sub arn:aws:lambda:${AWS::Region}:887080169480:layer:php73:3 Events: api: Type: Api From 12376ee79e7c998b26088e628ae4a9e63270d4db Mon Sep 17 00:00:00 2001 From: baso10 Date: Sat, 2 Nov 2019 10:28:11 +0100 Subject: [PATCH 09/10] encode url params --- bootstrap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap b/bootstrap index 5fcf610..b02115c 100755 --- a/bootstrap +++ b/bootstrap @@ -134,10 +134,10 @@ while (true) { $uri .= "&"; } - $uri .= $name; + $uri .= rawurlencode($name); if ($value != '') { - $uri .= '=' . $value; + $uri .= '=' . rawurlencode($value); } } } From 5c3910c041d55c103069effb5a96d8965d78e12f Mon Sep 17 00:00:00 2001 From: baso10 Date: Sat, 2 Nov 2019 11:00:32 +0100 Subject: [PATCH 10/10] always include = sign in query params --- bootstrap | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap b/bootstrap index b02115c..bf39035 100755 --- a/bootstrap +++ b/bootstrap @@ -134,10 +134,10 @@ while (true) { $uri .= "&"; } - $uri .= rawurlencode($name); + $uri .= rawurlencode($name) . '='; if ($value != '') { - $uri .= '=' . rawurlencode($value); + $uri .= rawurlencode($value); } } }