Skip to content

Commit c081de0

Browse files
authored
Updated documentation for ini file locations and ALB requests
1 parent 2f32b04 commit c081de0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

README.md

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# PHP Layer For AWS Lambda
22

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.
44

55
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)!
66

@@ -21,7 +21,14 @@ The layer runs the PHP 7.1 [PHP webserver](http://php.net/manual/en/features.com
2121
$ php -S localhost:8000 '<handler>'
2222
```
2323

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
2532

2633
##### Extensions
2734
The following extensions are built into the layer and available in /opt/lib/php/7.1/modules:
@@ -55,16 +62,14 @@ xsl.so
5562
zip.so
5663
```
5764

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:
5966

6067
```ini
6168
extension=json.so
6269
```
6370

6471
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.
6572

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-
6873
#### SAM Example
6974
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.
7075

0 commit comments

Comments
 (0)