Skip to content

Commit dec67e0

Browse files
committed
fix(examples): replace phpinfo() with hello world in php examples
The php and php-zip examples called phpinfo() in index.php, which renders the full PHP environment — including the Lambda-injected AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN — to anyone hitting the public endpoint. Users following the examples as-is would expose their function's temporary execution-role credentials. Replace the phpinfo() call with a plain-text "Hello, World!" response and update the php-zip README verification step accordingly.
1 parent 48caa3d commit dec67e0

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

‎examples/php-zip/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ When the deployment completes, take note of URL's Value. It is the API Gateway e
2323

2424
### Verify it works
2525

26-
Open URL's URL in a browser, you should see `phpinfo()` on the page.
26+
Open URL's URL in a browser, you should see `Hello, World!` on the page.

‎examples/php-zip/app/public/index.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
require __DIR__ . '/../vendor/autoload.php';
44

5-
phpinfo();
5+
header('Content-Type: text/plain');
6+
7+
echo "Hello, World!";

‎examples/php/app/public/index.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@
22

33
require __DIR__ . '/../vendor/autoload.php';
44

5-
phpinfo();
5+
header('Content-Type: text/plain');
6+
7+
echo "Hello, World!";

0 commit comments

Comments
 (0)