You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-26
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,20 @@
1
1
# PHP Layer For AWS Lambda
2
2
3
-
Ever wanted to run PHP websites in AWS Lambda? It's your lucky day! This Lambda Runtime Layer runs the [PHP 7.1/7.2/7.3 webserver](http://php.net/manual/en/features.commandline.webserver.php) in response to [AWS API Gateway](https://aws.amazon.com/api-gateway/) or [AWS Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/features/#Details_for_Elastic_Load_Balancing_Products) requests.
3
+
Ever wanted to run PHP websites in AWS Lambda? It's your lucky day! This Lambda Runtime Layer runs the [PHP 7.1/7.2/7.3 webserver](http://php.net/manual/en/features.commandline.webserver.php) in response to [AWS API Gateway](https://aws.amazon.com/api-gateway/) or [AWS Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/features/#Details_for_Elastic_Load_Balancing_Products) requests.
4
4
5
-
This project is fork of the [Stackery](https://stackery.io)[php-lambda-layer](https://github.com/stackery/php-lambda-layer) that has been modified to:
5
+
And, if you're looking for a great way to build serverless apps of all kinds, be sure to check out [Stackery](https://stackery.io)!
6
6
7
-
- support PHP 7.1, 7.2, and 7.3 (the original supports 7.1 only) - using the [Remi RPM Repository](https://rpms.remirepo.net/)
8
-
- add support for mbstring, MySQL (pdo-mysql) and Postgres (pdo-pgsql)
7
+
This is an early iteration of the PHP runtime Layer which is not yet ready for production. Please feel free to use this Layer to learn about the Lambda Layers feature and begin experimenting with PHP functions. We welcome feedback and stay tuned for the production-ready version coming soon.
9
8
10
-
that are requirements for running frameworks such as [Lumen](https://lumen.laravel.com/) and [Laravel](https://laravel.com/) frameworks in serverless mode.
9
+
## Current Layer Version ARN
10
+
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 ARN for PHP 7.1 is:
11
11
12
-
This is an early iteration of the PHP runtime Layer which is not yet ready for production. Please feel free to use this Layer to learn about the Lambda Layers feature and begin experimenting with PHP functions. We welcome feedback and stay tuned for the production-ready version coming soon.
If you need a layer for PHP 7.2 or 7.3, you can build your own.
15
+
You can find an example [here](http://tinyurl.com/ycsbfpbr).
16
+
17
+
See [Releases](https://github.com/stackery/php-lambda-layer/releases) for release notes.
13
18
14
19
### Usage
15
20
#### General Usage
@@ -24,14 +29,14 @@ The Lambda Function Handler property specifies the location of the the script ex
24
29
#### Configuration Files
25
30
There are three locations where PHP configuration may be located:
26
31
27
-
* Files in layer code packages located under /etc/php-<PHP_VERSION>.d/
28
-
* Files in function code package located under /php-<PHP_VERSION>.d/
32
+
* Files in layer code packages located under /etc/php-${PHP_VERSION}.d/
33
+
* Files in function code package located under /php-${PHP_VERSION}.d/
29
34
* php.ini located at the root of the function code package
30
35
31
-
Replace <PHP_VERSION> with 7.1, 7.2, or 7.3 according to your preferred runtime.
36
+
Replace ${PHP_VERSION} with '7.1', '7.2', or '7.3' according to your preferred runtime.
32
37
33
38
##### Extensions
34
-
The following extensions are built into the layer and available in /opt/lib/php/7.1/modules (PHP 7.1) or /opt/lib/php/modules (PHP 7.2/7.3):
39
+
The following extensions are built into the layer and available in /opt/lib/php/${PHP_VERSION}/modules:
35
40
36
41
```
37
42
bz2.so
@@ -45,20 +50,11 @@ ftp.so
45
50
gettext.so
46
51
iconv.so
47
52
json.so
48
-
mbstring.so
49
-
mysqli.so
50
-
mysqlnd.so
51
-
pdo.so
52
-
pdo_mysql.so
53
-
pdo_pgsql.so
54
-
pdo_sqlite.so
55
-
pgsql.so
56
53
phar.so
57
54
posix.so
58
55
shmop.so
59
56
simplexml.so
60
57
sockets.so
61
-
sqlite3.so
62
58
sysvmsg.so
63
59
sysvsem.so
64
60
sysvshm.so
@@ -77,7 +73,7 @@ These extensions are not loaded by default. You must add the extension to a php.
77
73
extension=json.so
78
74
```
79
75
80
-
Extensions can be built using the lambci/lambda:build-nodejs8.10 Docker image. It is recommended that custom extensions be provided by a separate Lambda Layer with the extension .so files placed in /lib/php/7.1/modules/ so they can be loaded alongside the built-in extensions listed above.
76
+
Extensions can be built using the lambci/lambda:build-nodejs8.10 Docker image. It is recommended that custom extensions be provided by a separate Lambda Layer with the extension .so files placed in /lib/php/${PHP_VERSION}/modules/ so they can be loaded alongside the built-in extensions listed above.
81
77
82
78
#### SAM Example
83
79
Let's create an AWS SAM PHP application. We suggest using [Stackery](https://stackery.io) to make this super simple. It automates all the scaffolding shown below. But you may also choose to roll your own application from scratch.
0 commit comments