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
+10-5
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
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 webserver](http://php.net/manual/en/features.commandline.webserver.php) in response to [AWS API Gateway](https://aws.amazon.com/api-gateway/) 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 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
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
@@ -21,7 +21,14 @@ The layer runs the PHP 7.1 [PHP webserver](http://php.net/manual/en/features.com
21
21
$ php -S localhost:8000 '<handler>'
22
22
```
23
23
24
-
The Lambda Function Handler property specifies the location of the the script executed in response to an incoming API Gateway request.
24
+
The Lambda Function Handler property specifies the location of the the script executed in response to an incoming API Gateway or Application Load Balancer request.
25
+
26
+
#### Configuration Files
27
+
There are three locations where PHP configuration may be located:
28
+
29
+
* Files in layer code packages located under /etc/php-7.1.d/
30
+
* Files in function code package located under /php-7.1.d/
31
+
* php.ini located at the root of the function code package
25
32
26
33
##### Extensions
27
34
The following extensions are built into the layer and available in /opt/lib/php/7.1/modules:
@@ -55,16 +62,14 @@ xsl.so
55
62
zip.so
56
63
```
57
64
58
-
These extensions are not loaded by default. You must add the extension to your php.ini file to use it:
65
+
These extensions are not loaded by default. You must add the extension to a php.ini file to use it:
59
66
60
67
```ini
61
68
extension=json.so
62
69
```
63
70
64
71
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.
65
72
66
-
The extensions can be loaded by adding an ini file in the etc/php-7.1.d this will be picked up automatically
67
-
68
73
#### SAM Example
69
74
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