From dec67e0ee49d4c3a95dbd49c28c98ec0e1518a85 Mon Sep 17 00:00:00 2001 From: Harold Sun Date: Tue, 14 Jul 2026 16:51:18 +0000 Subject: [PATCH] fix(examples): replace phpinfo() with hello world in php examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- examples/php-zip/README.md | 2 +- examples/php-zip/app/public/index.php | 4 +++- examples/php/app/public/index.php | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/php-zip/README.md b/examples/php-zip/README.md index 0c53ac9b..5151a75e 100644 --- a/examples/php-zip/README.md +++ b/examples/php-zip/README.md @@ -23,4 +23,4 @@ When the deployment completes, take note of URL's Value. It is the API Gateway e ### Verify it works -Open URL's URL in a browser, you should see `phpinfo()` on the page. +Open URL's URL in a browser, you should see `Hello, World!` on the page. diff --git a/examples/php-zip/app/public/index.php b/examples/php-zip/app/public/index.php index 29007318..10f8a33c 100644 --- a/examples/php-zip/app/public/index.php +++ b/examples/php-zip/app/public/index.php @@ -2,4 +2,6 @@ require __DIR__ . '/../vendor/autoload.php'; -phpinfo(); +header('Content-Type: text/plain'); + +echo "Hello, World!"; diff --git a/examples/php/app/public/index.php b/examples/php/app/public/index.php index 29007318..10f8a33c 100644 --- a/examples/php/app/public/index.php +++ b/examples/php/app/public/index.php @@ -2,4 +2,6 @@ require __DIR__ . '/../vendor/autoload.php'; -phpinfo(); +header('Content-Type: text/plain'); + +echo "Hello, World!";